Skip to content

Commit

Permalink
Require -Z unstable-options for unstable editions.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ou-se committed Dec 31, 2020
1 parent c574ded commit 3d9d0e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler/rustc_session/src/config.rs
Expand Up @@ -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,
),
)
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/hello2021.rs
@@ -1,5 +1,6 @@
// run-pass
// edition:2021
// compile-flags: -Zunstable-options

fn main() {
println!("hello, 2021");
Expand Down

0 comments on commit 3d9d0e9

Please sign in to comment.