diff --git a/configure b/configure index ea9320c901b6d..61c737e0fd3af 100755 --- a/configure +++ b/configure @@ -599,6 +599,18 @@ then fi putvar CFG_RELEASE_CHANNEL +# A magic value that allows the compiler to use unstable features +# during the bootstrap even when doing so would normally be an error +# because of feature staging or because the build turns on +# warnings-as-errors and unstable features default to warnings. The +# build has to match this key in an env var. Meant to be a mild +# deterrent from users just turning on unstable features on the stable +# channel. +# Basing CFG_BOOTSTRAP_KEY on CFG_BOOTSTRAP_KEY lets it get picked up +# during a Makefile reconfig. +CFG_BOOTSTRAP_KEY="${CFG_BOOTSTRAP_KEY-`date +%N`}" +putvar CFG_BOOTSTRAP_KEY + step_msg "looking for build programs" probe_need CFG_PERL perl diff --git a/mk/main.mk b/mk/main.mk index a97e68af59b38..99aecc34be973 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -25,11 +25,13 @@ ifeq ($(CFG_RELEASE_CHANNEL),stable) CFG_RELEASE=$(CFG_RELEASE_NUM) # This is the string used in dist artifact file names, e.g. "0.12.0", "nightly" CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM) +CFG_DISABLE_UNSTABLE_FEATURES=1 endif ifeq ($(CFG_RELEASE_CHANNEL),beta) # The beta channel is temporarily called 'alpha' CFG_RELEASE=$(CFG_RELEASE_NUM)-alpha$(CFG_BETA_CYCLE) CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-alpha$(CFG_BETA_CYCLE) +CFG_DISABLE_UNSTABLE_FEATURES=1 endif ifeq ($(CFG_RELEASE_CHANNEL),nightly) CFG_RELEASE=$(CFG_RELEASE_NUM)-nightly @@ -121,11 +123,9 @@ CFG_JEMALLOC_FLAGS += $(JEMALLOC_FLAGS) ifdef CFG_DISABLE_DEBUG CFG_RUSTC_FLAGS += --cfg ndebug - CFG_GCCISH_CFLAGS += -DRUST_NDEBUG else $(info cfg: enabling more debugging (CFG_ENABLE_DEBUG)) CFG_RUSTC_FLAGS += --cfg debug - CFG_GCCISH_CFLAGS += -DRUST_DEBUG endif ifdef SAVE_TEMPS @@ -319,11 +319,20 @@ export CFG_VERSION_WIN export CFG_RELEASE export CFG_PACKAGE_NAME export CFG_BUILD +export CFG_RELEASE_CHANNEL export CFG_LLVM_ROOT export CFG_PREFIX export CFG_LIBDIR export CFG_LIBDIR_RELATIVE export CFG_DISABLE_INJECT_STD_VERSION +ifdef CFG_DISABLE_UNSTABLE_FEATURES +CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES)) +# Turn on feature-staging +export CFG_DISABLE_UNSTABLE_FEATURES +endif +# Subvert unstable feature lints to do the self-build +export CFG_BOOTSTRAP_KEY +export RUSTC_BOOTSTRAP_KEY:=$(CFG_BOOTSTRAP_KEY) ###################################################################### # Per-stage targets and runner diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs index e2420b0a22024..9a5665e683934 100644 --- a/src/compiletest/compiletest.rs +++ b/src/compiletest/compiletest.rs @@ -9,7 +9,9 @@ // except according to those terms. #![crate_type = "bin"] +#![allow(unknown_features)] #![feature(slicing_syntax, unboxed_closures)] +#![feature(box_syntax)] #![deny(warnings)] diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index f8e2ba4828f38..5de93c5202922 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -908,8 +908,7 @@ fn check_error_patterns(props: &TestProps, } if done { return; } - let missing_patterns = - props.error_patterns.index(&(next_err_idx..)); + let missing_patterns = &props.error_patterns[next_err_idx..]; if missing_patterns.len() == 1u { fatal_proc_rec(format!("error pattern '{}' not found!", missing_patterns[0]).as_slice(), diff --git a/src/doc/footer.inc b/src/doc/footer.inc index 4e7d60586f23d..f32f2fd443f8e 100644 --- a/src/doc/footer.inc +++ b/src/doc/footer.inc @@ -1,5 +1,5 @@