From f230e662420d8d1f326baa512f640ba26db8e622 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 17 Sep 2018 13:15:13 -0700 Subject: [PATCH] Clarify nightly-ness of `Closure::new` `Closure` itself does not require nightly, only the `new` function. --- src/closure.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/closure.rs b/src/closure.rs index ba9612de..5c45b065 100644 --- a/src/closure.rs +++ b/src/closure.rs @@ -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 Closure /// /// 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(t: F) -> Closure where F: Unsize + 'static