diff --git a/Cargo.toml b/Cargo.toml index 8dba390..6d047b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,3 +61,7 @@ name = "chars" [[example]] name = "is_zalgo" + + +[package.metadata.docs.rs] +features = ["nightly"] diff --git a/build.rs b/build.rs index 16da5b1..e8b1888 100644 --- a/build.rs +++ b/build.rs @@ -8,12 +8,17 @@ use rustc_version::{Version, version}; fn run_rustc_version() { let version = version().unwrap(); + if version >= Version::parse("1.21.0").unwrap() { + // This should be the relevant issue: https://github.com/rust-lang/rust/pull/43690 + println!("cargo:rustc-cfg=fn_clone"); + } + if version >= Version::parse("1.26.0").unwrap() { println!("cargo:rustc-cfg=stable_fused_iterator"); } if version >= Version::parse("1.27.0").unwrap() { - // We won't be able to define `Iterator::try_fold` and `DoubleEndedIterator::try_fold` + // We won't be able to define `Iterator::try_fold` and `DoubleEndedIterator::try_rfold` // in stable anyway because both require a type parameter bounded by `ops::Try` which is // not going to stabilize yet. //println!("cargo:rustc-cfg=stable_iterator_try_fold"); diff --git a/src/unapply_iter.rs b/src/unapply_iter.rs index e86a320..071b409 100644 --- a/src/unapply_iter.rs +++ b/src/unapply_iter.rs @@ -10,7 +10,9 @@ use core::ops; /// /// [`unapply_iter`]: fn.unapply_iter.html #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] -#[derive(Clone, Debug)] +// This should be the relevant issue: https://github.com/rust-lang/rust/pull/43690 +#[cfg_attr(fn_clone, derive(Clone))] +#[derive(Debug)] pub struct UnapplyIter { pub(crate) inner: iter::Filter bool>, }