mirror of
https://github.com/rust-lang/rust
synced 2024-09-05 16:57:03 +00:00
Revise logic to match rustc::session::config::get_unstable_features_setting
This commit is contained in:
parent
eaea188d96
commit
9b8957f1d4
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue