Skip to content

Commit 9b8957f

Browse files
committed
Revise logic to match rustc::session::config::get_unstable_features_setting
1 parent eaea188 commit 9b8957f

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Diff for: src/libsyntax/feature_gate.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,7 @@ pub fn emit_feature_err(diag: &SpanHandler, feature: &str, span: Span, explain:
411411
diag.span_err(span, explain);
412412

413413
// #23973: do not suggest `#![feature(...)]` if we are in beta/stable
414-
match option_env!("CFG_RELEASE_CHANNEL") {
415-
Some("stable") | Some("beta") => return,
416-
_ => {}
417-
}
414+
if option_env!("CFG_DISABLE_UNSTABLE_FEATURES").is_some() { return; }
418415
diag.fileline_help(span, &format!("add #![feature({})] to the \
419416
crate attributes to enable",
420417
feature));
@@ -424,10 +421,7 @@ pub fn emit_feature_warn(diag: &SpanHandler, feature: &str, span: Span, explain:
424421
diag.span_warn(span, explain);
425422

426423
// #23973: do not suggest `#![feature(...)]` if we are in beta/stable
427-
match option_env!("CFG_RELEASE_CHANNEL") {
428-
Some("stable") | Some("beta") => return,
429-
_ => {}
430-
}
424+
if option_env!("CFG_DISABLE_UNSTABLE_FEATURES").is_some() { return; }
431425
if diag.handler.can_emit_warnings {
432426
diag.fileline_help(span, &format!("add #![feature({})] to the \
433427
crate attributes to silence this warning",

0 commit comments

Comments
 (0)