1
Fork 0

Require -Z unstable-options for unstable editions.

This commit is contained in:
Mara Bos 2020-12-24 16:48:41 +01:00
parent c574ded57d
commit 3d9d0e9d3e
2 changed files with 3 additions and 3 deletions

View file

@ -1308,12 +1308,11 @@ fn parse_crate_edition(matches: &getopts::Matches) -> Edition {
None => DEFAULT_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( early_error(
ErrorOutputType::default(), ErrorOutputType::default(),
&format!( &format!(
"edition {} is unstable and only \ "edition {} is unstable and only available with -Z unstable-options.",
available for nightly builds of rustc.",
edition, edition,
), ),
) )

View file

@ -1,5 +1,6 @@
// run-pass // run-pass
// edition:2021 // edition:2021
// compile-flags: -Zunstable-options
fn main() { fn main() {
println!("hello, 2021"); println!("hello, 2021");