about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2020-12-24 16:48:41 +0100
committerMara Bos <m-ou.se@m-ou.se>2020-12-31 19:06:09 +0100
commit3d9d0e9d3edd6ef767817e5432b6869929ab0058 (patch)
tree0f076b1a85154a22a700d2d895b3ed4ec840cd46
parentc574ded57da4c7c631b836c397f31d2a72dc1280 (diff)
Require `-Z unstable-options` for unstable editions.
-rw-r--r--compiler/rustc_session/src/config.rs5
-rw-r--r--src/test/ui/hello2021.rs1
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs
index c9ddcbdb5f5..62859f4bef4 100644
--- a/compiler/rustc_session/src/config.rs
+++ b/compiler/rustc_session/src/config.rs
@@ -1308,12 +1308,11 @@ fn parse_crate_edition(matches: &getopts::Matches) -> Edition {
         None => DEFAULT_EDITION,
     };
 
-    if !edition.is_stable() && !nightly_options::match_is_nightly_build(matches) {
+    if !edition.is_stable() && !nightly_options::is_unstable_enabled(matches) {
         early_error(
             ErrorOutputType::default(),
             &format!(
-                "edition {} is unstable and only \
-                     available for nightly builds of rustc.",
+                "edition {} is unstable and only available with -Z unstable-options.",
                 edition,
             ),
         )
diff --git a/src/test/ui/hello2021.rs b/src/test/ui/hello2021.rs
index 134d8af5bfb..738f151b0f6 100644
--- a/src/test/ui/hello2021.rs
+++ b/src/test/ui/hello2021.rs
@@ -1,5 +1,6 @@
 // run-pass
 // edition:2021
+// compile-flags: -Zunstable-options
 
 fn main() {
     println!("hello, 2021");