Merge pull request #844 from alexcrichton/dox

Clarify nightly-ness of `Closure::new`
This commit is contained in:
Nick Fitzgerald 2018-09-17 15:16:45 -07:00 committed by GitHub
commit 4db375ba97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,8 +3,6 @@
//! This module defines the `Closure` type which is used to pass "owned
//! closures" from Rust to JS. Some more details can be found on the `Closure`
//! type itself.
//!
//! The `nightly` feature is required for the `Closure` type to be used.
use std::cell::UnsafeCell;
#[cfg(feature = "nightly")]
@ -89,6 +87,10 @@ impl<T> Closure<T>
///
/// This is unfortunately pretty restrictive for now but hopefully some of
/// these restrictions can be lifted in the future!
///
/// *This method requires the `nightly` feature of the `wasm-bindgen` crate
/// to be enabled, meaning this is a nightly-only API. Users on stable
/// should use `Closure::wrap`.*
#[cfg(feature = "nightly")]
pub fn new<F>(t: F) -> Closure<T>
where F: Unsize<T> + 'static