mirror of
https://github.com/rust-lang/rust
synced 2024-11-02 13:50:48 +00:00
Do not suggest #![feature(...)]
if we are in beta or stable channel.
Fix #23973
This commit is contained in:
parent
cf00fc4da9
commit
eaea188d96
1 changed files with 12 additions and 0 deletions
|
@ -409,6 +409,12 @@ fn check_attribute(&self, attr: &ast::Attribute) {
|
|||
|
||||
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
|
||||
match option_env!("CFG_RELEASE_CHANNEL") {
|
||||
Some("stable") | Some("beta") => return,
|
||||
_ => {}
|
||||
}
|
||||
diag.fileline_help(span, &format!("add #![feature({})] to the \
|
||||
crate attributes to enable",
|
||||
feature));
|
||||
|
@ -416,6 +422,12 @@ 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
|
||||
match option_env!("CFG_RELEASE_CHANNEL") {
|
||||
Some("stable") | Some("beta") => return,
|
||||
_ => {}
|
||||
}
|
||||
if diag.handler.can_emit_warnings {
|
||||
diag.fileline_help(span, &format!("add #![feature({})] to the \
|
||||
crate attributes to silence this warning",
|
||||
|
|
Loading…
Reference in a new issue