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
Copy file name to clipboardExpand all lines: compiler/rustc_session/src/config.rs
+13-5
Original file line number
Diff line number
Diff line change
@@ -2959,6 +2959,7 @@ pub mod nightly_options {
2959
2959
){
2960
2960
let has_z_unstable_option = matches.opt_strs("Z").iter().any(|x| *x == "unstable-options");
2961
2961
let really_allows_unstable_options = match_is_nightly_build(matches);
2962
+
letmut nightly_options_on_stable = 0;
2962
2963
2963
2964
for opt in flags.iter(){
2964
2965
if opt.stability == OptionStability::Stable{
@@ -2979,20 +2980,27 @@ pub mod nightly_options {
2979
2980
}
2980
2981
match opt.stability{
2981
2982
OptionStability::Unstable => {
2983
+
nightly_options_on_stable += 1;
2982
2984
let msg = format!(
2983
2985
"the option `{}` is only accepted on the nightly compiler",
2984
2986
opt.name
2985
2987
);
2986
2988
let _ = handler.early_error_no_abort(msg);
2987
-
handler.early_note("selecting a toolchain with `+toolchain` arguments require a rustup proxy; see <https://rust-lang.github.io/rustup/concepts/index.html>");
2988
-
handler.early_help(
2989
-
"consider switching to a nightly toolchain: `rustup default nightly`",
2990
-
);
2991
-
handler.early_note("for more information about Rust's stability policy, see <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#unstable-features>");
2992
2989
}
2993
2990
OptionStability::Stable => {}
2994
2991
}
2995
2992
}
2993
+
if nightly_options_on_stable > 0{
2994
+
handler
2995
+
.early_help("consider switching to a nightly toolchain: `rustup default nightly`");
2996
+
handler.early_note("selecting a toolchain with `+toolchain` arguments require a rustup proxy; see <https://rust-lang.github.io/rustup/concepts/index.html>");
2997
+
handler.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