From 84b617b1ea700b512a6f8d79fe7ae76eb2966316 Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Tue, 14 May 2019 18:15:20 -0700 Subject: [PATCH 1/2] Fix features since nightly-2018-08-14 disallowed old features --- build.rs | 7 ++++++- ct.sh | 2 ++ src/lib.rs | 11 ++++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/build.rs b/build.rs index 17f5359..0f3df92 100644 --- a/build.rs +++ b/build.rs @@ -52,6 +52,11 @@ type Date = &'static str; /// versions for which to enable particular features. type ConditionalCfg = (Cfg, &'static [(Date, Cfg)]); const CONDITIONAL_CFGS: &'static [ConditionalCfg] = &[ + (None, &[("2019-02-24", Some("pattern_guards"))]), + (None, &[("2018-08-14", Some("non_exhaustive"))]), + (Some("collections"), &[("2018-08-13", None)]), + (Some("str_char"), &[("2018-08-13", None)]), + (Some("unicode"), &[("2018-08-13", None)]), (None, &[("2018-01-01", Some("core_memchr"))]), (None, &[("2017-06-15", Some("no_collections"))]), (Some("rustc_unicode"), &[("2016-12-15", Some("std_unicode")), ("2017-03-03", None)]), @@ -87,7 +92,7 @@ fn main() { let mut dest_path=PathBuf::from(env::var_os("OUT_DIR").unwrap()); dest_path.push("io.rs"); let mut f=File::create(&dest_path).unwrap(); - + let mut target_path=PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); target_path.push("src"); target_path.push(io_commit); diff --git a/ct.sh b/ct.sh index 48a9703..b13083c 100755 --- a/ct.sh +++ b/ct.sh @@ -18,6 +18,8 @@ RUST_VERSIONS=$(awk '{print $1}' < Date: Thu, 6 Jun 2019 19:46:25 -0700 Subject: [PATCH 2/2] Address review comments --- build.rs | 2 -- src/lib.rs | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/build.rs b/build.rs index 0f3df92..26c0c44 100644 --- a/build.rs +++ b/build.rs @@ -54,8 +54,6 @@ type ConditionalCfg = (Cfg, &'static [(Date, Cfg)]); const CONDITIONAL_CFGS: &'static [ConditionalCfg] = &[ (None, &[("2019-02-24", Some("pattern_guards"))]), (None, &[("2018-08-14", Some("non_exhaustive"))]), - (Some("collections"), &[("2018-08-13", None)]), - (Some("str_char"), &[("2018-08-13", None)]), (Some("unicode"), &[("2018-08-13", None)]), (None, &[("2018-01-01", Some("core_memchr"))]), (None, &[("2017-06-15", Some("no_collections"))]), diff --git a/src/lib.rs b/src/lib.rs index c527005..72c1bb5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,9 +7,9 @@ doc_spotlight,slice_internals)] #![cfg_attr(any(feature="alloc",feature="collections"),feature(alloc))] #![cfg_attr(pattern_guards,feature(bind_by_move_pattern_guards,nll))] -#![cfg_attr(collections,feature(collections))] +#![cfg_attr(not(no_collections),feature(collections))] #![cfg_attr(non_exhaustive,feature(non_exhaustive))] -#![cfg_attr(str_char,feature(str_char))] +#![cfg_attr(unicode,feature(str_char))] #![cfg_attr(unicode,feature(unicode))] #![no_std]