Skip to content

Commit ab74dfd

Browse files
committed
Remove a [derive(Clone)] for Rust 1.20
This should be the relevant issue: rust-lang/rust#43690.
1 parent 3f2c4c0 commit ab74dfd

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,7 @@ name = "chars"
6161

6262
[[example]]
6363
name = "is_zalgo"
64+
65+
66+
[package.metadata.docs.rs]
67+
features = ["nightly"]

build.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@ use rustc_version::{Version, version};
88
fn run_rustc_version() {
99
let version = version().unwrap();
1010

11+
if version >= Version::parse("1.21.0").unwrap() {
12+
// This should be the relevant issue: https://github.com/rust-lang/rust/pull/43690
13+
println!("cargo:rustc-cfg=fn_clone");
14+
}
15+
1116
if version >= Version::parse("1.26.0").unwrap() {
1217
println!("cargo:rustc-cfg=stable_fused_iterator");
1318
}
1419

1520
if version >= Version::parse("1.27.0").unwrap() {
16-
// We won't be able to define `Iterator::try_fold` and `DoubleEndedIterator::try_fold`
21+
// We won't be able to define `Iterator::try_fold` and `DoubleEndedIterator::try_rfold`
1722
// in stable anyway because both require a type parameter bounded by `ops::Try` which is
1823
// not going to stabilize yet.
1924
//println!("cargo:rustc-cfg=stable_iterator_try_fold");

src/unapply_iter.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ use core::ops;
1010
///
1111
/// [`unapply_iter`]: fn.unapply_iter.html
1212
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
13-
#[derive(Clone, Debug)]
13+
// This should be the relevant issue: https://github.com/rust-lang/rust/pull/43690
14+
#[cfg_attr(fn_clone, derive(Clone))]
15+
#[derive(Debug)]
1416
pub struct UnapplyIter<I> {
1517
pub(crate) inner: iter::Filter<I, fn(&char) -> bool>,
1618
}

0 commit comments

Comments
 (0)