You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let has_z_unstable_option = matches.opt_strs("Z").iter().any(|x| *x == "unstable-options");
2717
-
let really_allows_unstable_options = match_is_nightly_build(matches);
2718
-
letmut nightly_options_on_stable = 0;
2719
-
2720
-
for opt in flags.iter(){
2721
-
if opt.stability == OptionStability::Stable{
2722
-
continue;
2723
-
}
2724
-
if !matches.opt_present(opt.name){
2725
-
continue;
2726
-
}
2727
-
if opt.name != "Z" && !has_z_unstable_option {
2728
-
early_dcx.early_fatal(format!(
2729
-
"the `-Z unstable-options` flag must also be passed to enable \
2730
-
the flag `{}`",
2731
-
opt.name
2732
-
));
2733
-
}
2734
-
if really_allows_unstable_options {
2735
-
continue;
2736
-
}
2737
-
match opt.stability{
2738
-
OptionStability::Unstable => {
2739
-
nightly_options_on_stable += 1;
2740
-
let msg = format!(
2741
-
"the option `{}` is only accepted on the nightly compiler",
2742
-
opt.name
2743
-
);
2744
-
let _ = early_dcx.early_err(msg);
2745
-
}
2746
-
OptionStability::Stable => {}
2747
-
}
2748
-
}
2749
-
if nightly_options_on_stable > 0{
2750
-
early_dcx
2751
-
.early_help("consider switching to a nightly toolchain: `rustup default nightly`");
2752
-
early_dcx.early_note("selecting a toolchain with `+toolchain` arguments require a rustup proxy; see <https://rust-lang.github.io/rustup/concepts/index.html>");
2753
-
early_dcx.early_note("for more information about Rust's stability policy, see <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#unstable-features>");
let has_z_unstable_option = matches.opt_strs("Z").iter().any(|x| *x == "unstable-options");
25
+
let really_allows_unstable_options = match_is_nightly_build(matches);
26
+
letmut nightly_options_on_stable = 0;
27
+
28
+
for opt in flags.iter(){
29
+
if opt.stability == OptionStability::Stable{
30
+
continue;
31
+
}
32
+
if !matches.opt_present(opt.name){
33
+
continue;
34
+
}
35
+
if opt.name != "Z" && !has_z_unstable_option {
36
+
early_dcx.early_fatal(format!(
37
+
"the `-Z unstable-options` flag must also be passed to enable the flag `{}`",
38
+
opt.name
39
+
));
40
+
}
41
+
if really_allows_unstable_options {
42
+
continue;
43
+
}
44
+
match opt.stability{
45
+
OptionStability::Unstable => {
46
+
nightly_options_on_stable += 1;
47
+
let msg =
48
+
format!("the option `{}` is only accepted on the nightly compiler", opt.name);
49
+
let _ = early_dcx.early_err(msg);
50
+
}
51
+
OptionStability::Stable => {}
52
+
}
53
+
}
54
+
if nightly_options_on_stable > 0{
55
+
early_dcx.early_help("consider switching to a nightly toolchain: `rustup default nightly`");
56
+
early_dcx.early_note("selecting a toolchain with `+toolchain` arguments require a rustup proxy; see <https://rust-lang.github.io/rustup/concepts/index.html>");
57
+
early_dcx.early_note("for more information about Rust's stability policy, see <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#unstable-features>");
0 commit comments