Skip to content

Commit 4db375b

Browse files
authored
Merge pull request #844 from alexcrichton/dox
Clarify nightly-ness of `Closure::new`
2 parents 1ee5790 + f230e66 commit 4db375b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/closure.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//! This module defines the `Closure` type which is used to pass "owned
44
//! closures" from Rust to JS. Some more details can be found on the `Closure`
55
//! type itself.
6-
//!
7-
//! The `nightly` feature is required for the `Closure` type to be used.
86
97
use std::cell::UnsafeCell;
108
#[cfg(feature = "nightly")]
@@ -89,6 +87,10 @@ impl<T> Closure<T>
8987
///
9088
/// This is unfortunately pretty restrictive for now but hopefully some of
9189
/// these restrictions can be lifted in the future!
90+
///
91+
/// *This method requires the `nightly` feature of the `wasm-bindgen` crate
92+
/// to be enabled, meaning this is a nightly-only API. Users on stable
93+
/// should use `Closure::wrap`.*
9294
#[cfg(feature = "nightly")]
9395
pub fn new<F>(t: F) -> Closure<T>
9496
where F: Unsize<T> + 'static

0 commit comments

Comments
 (0)