提交 3d9d0e9d 编写于 作者: M Mara Bos

Require `-Z unstable-options` for unstable editions.

上级 c574ded5
......@@ -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,
),
)
......
// run-pass
// edition:2021
// compile-flags: -Zunstable-options
fn main() {
println!("hello, 2021");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册