diff options
| author | bors <bors@rust-lang.org> | 2015-04-03 01:44:00 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-04-03 01:44:00 +0000 |
| commit | 5e30f05a05326018357c6fffdfb872e8a8d2367c (patch) | |
| tree | 883e6056aceda017cd6d10449dab6458e01ce1d8 /src/libsyntax | |
| parent | d17d6e7f1f05fbdd4d9d246400ffebf768878c7a (diff) | |
| parent | f6a06808ec0ec9dec2ca8b5bd2b37c1c66119d95 (diff) | |
| download | rust-5e30f05a05326018357c6fffdfb872e8a8d2367c.tar.gz rust-5e30f05a05326018357c6fffdfb872e8a8d2367c.zip | |
Auto merge of #23974 - pnkfelix:fix-23973, r=alexcrichton
Do not suggest `#![feature(...)]` if we are in beta or stable channel. Fix #23973
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index dbddd9dd44d..689b4595d39 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -409,6 +409,9 @@ impl<'a> Context<'a> { pub fn emit_feature_err(diag: &SpanHandler, feature: &str, span: Span, explain: &str) { diag.span_err(span, explain); + + // #23973: do not suggest `#![feature(...)]` if we are in beta/stable + if option_env!("CFG_DISABLE_UNSTABLE_FEATURES").is_some() { return; } diag.fileline_help(span, &format!("add #![feature({})] to the \ crate attributes to enable", feature)); @@ -416,6 +419,9 @@ pub fn emit_feature_err(diag: &SpanHandler, feature: &str, span: Span, explain: pub fn emit_feature_warn(diag: &SpanHandler, feature: &str, span: Span, explain: &str) { diag.span_warn(span, explain); + + // #23973: do not suggest `#![feature(...)]` if we are in beta/stable + 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", |
