diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-04-02 17:47:51 +0200 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-04-02 17:47:51 +0200 |
| commit | 9b8957f1d4451090d6f3e7ac7f61731c8a4f1a80 (patch) | |
| tree | 9786ff1349ec9c00946d131aed6e9f28990fc2c2 /src/libsyntax | |
| parent | eaea188d9674c8b9eba36dec5f20277a6fe7ae43 (diff) | |
| download | rust-9b8957f1d4451090d6f3e7ac7f61731c8a4f1a80.tar.gz rust-9b8957f1d4451090d6f3e7ac7f61731c8a4f1a80.zip | |
Revise logic to match `rustc::session::config::get_unstable_features_setting`
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 2d6fbb7c683..689b4595d39 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -411,10 +411,7 @@ pub fn emit_feature_err(diag: &SpanHandler, feature: &str, span: Span, explain: diag.span_err(span, explain); // #23973: do not suggest `#![feature(...)]` if we are in beta/stable - match option_env!("CFG_RELEASE_CHANNEL") { - Some("stable") | Some("beta") => return, - _ => {} - } + if option_env!("CFG_DISABLE_UNSTABLE_FEATURES").is_some() { return; } diag.fileline_help(span, &format!("add #![feature({})] to the \ crate attributes to enable", feature)); @@ -424,10 +421,7 @@ pub fn emit_feature_warn(diag: &SpanHandler, feature: &str, span: Span, explain: diag.span_warn(span, explain); // #23973: do not suggest `#![feature(...)]` if we are in beta/stable - match option_env!("CFG_RELEASE_CHANNEL") { - Some("stable") | Some("beta") => return, - _ => {} - } + if option_env!("CFG_DISABLE_UNSTABLE_FEATURES").is_some() { return; } if diag.handler.can_emit_warnings { diag.fileline_help(span, &format!("add #![feature({})] to the \ crate attributes to silence this warning", |
