Skip to content

Commit

Permalink
Remove a [derive(Clone)] for Rust 1.20
Browse files Browse the repository at this point in the history
This should be the relevant issue: rust-lang/rust#43690.
  • Loading branch information
hcpl committed Apr 9, 2018
1 parent 3f2c4c0 commit ab74dfd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ name = "chars"

[[example]]
name = "is_zalgo"


[package.metadata.docs.rs]
features = ["nightly"]
7 changes: 6 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 3 additions & 1 deletion src/unapply_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<I> {
pub(crate) inner: iter::Filter<I, fn(&char) -> bool>,
}
Expand Down

0 comments on commit ab74dfd

Please sign in to comment.