mirror of
https://github.com/rust-lang/rust
synced 2024-11-02 11:53:40 +00:00
Auto merge of #23974 - pnkfelix:fix-23973, r=alexcrichton
Do not suggest `#![feature(...)]` if we are in beta or stable channel. Fix #23973
This commit is contained in:
commit
5e30f05a05
8 changed files with 6 additions and 8 deletions
|
@ -409,6 +409,9 @@ fn check_attribute(&self, attr: &ast::Attribute) {
|
||||||
|
|
||||||
pub fn emit_feature_err(diag: &SpanHandler, feature: &str, span: Span, explain: &str) {
|
pub fn emit_feature_err(diag: &SpanHandler, feature: &str, span: Span, explain: &str) {
|
||||||
diag.span_err(span, explain);
|
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 \
|
diag.fileline_help(span, &format!("add #![feature({})] to the \
|
||||||
crate attributes to enable",
|
crate attributes to enable",
|
||||||
feature));
|
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) {
|
pub fn emit_feature_warn(diag: &SpanHandler, feature: &str, span: Span, explain: &str) {
|
||||||
diag.span_warn(span, explain);
|
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 {
|
if diag.handler.can_emit_warnings {
|
||||||
diag.fileline_help(span, &format!("add #![feature({})] to the \
|
diag.fileline_help(span, &format!("add #![feature({})] to the \
|
||||||
crate attributes to silence this warning",
|
crate attributes to silence this warning",
|
||||||
|
|
|
@ -19,4 +19,3 @@
|
||||||
#[macro_use] #[no_link]
|
#[macro_use] #[no_link]
|
||||||
extern crate macro_reexport_1;
|
extern crate macro_reexport_1;
|
||||||
//~^ ERROR macros reexports are experimental and possibly buggy
|
//~^ ERROR macros reexports are experimental and possibly buggy
|
||||||
//~| HELP add #![feature(macro_reexport)] to the crate attributes to enable
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ fn main() {
|
||||||
match x {
|
match x {
|
||||||
box 1 => (),
|
box 1 => (),
|
||||||
//~^ box pattern syntax is experimental
|
//~^ box pattern syntax is experimental
|
||||||
//~| add #![feature(box_patterns)] to the crate attributes to enable
|
|
||||||
_ => ()
|
_ => ()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,5 +13,4 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = box 3;
|
let x = box 3;
|
||||||
//~^ ERROR box expression syntax is experimental; you can call `Box::new` instead.
|
//~^ ERROR box expression syntax is experimental; you can call `Box::new` instead.
|
||||||
//~| HELP add #![feature(box_syntax)] to the crate attributes to enable
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,5 @@
|
||||||
#[link_args = "aFdEfSeVEEE"]
|
#[link_args = "aFdEfSeVEEE"]
|
||||||
extern {}
|
extern {}
|
||||||
//~^ ERROR the `link_args` attribute is not portable across platforms
|
//~^ ERROR the `link_args` attribute is not portable across platforms
|
||||||
//~| HELP add #![feature(link_args)] to the crate attributes to enable
|
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#[link_name = "llvm.sqrt.f32"]
|
#[link_name = "llvm.sqrt.f32"]
|
||||||
fn sqrt(x: f32) -> f32;
|
fn sqrt(x: f32) -> f32;
|
||||||
//~^ ERROR linking to LLVM intrinsics is experimental
|
//~^ ERROR linking to LLVM intrinsics is experimental
|
||||||
//~| HELP add #![feature(link_llvm_intrinsics)] to the crate attributes
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main(){
|
fn main(){
|
||||||
|
|
|
@ -15,5 +15,4 @@
|
||||||
#[plugin_registrar]
|
#[plugin_registrar]
|
||||||
pub fn registrar() {}
|
pub fn registrar() {}
|
||||||
//~^ ERROR compiler plugins are experimental
|
//~^ ERROR compiler plugins are experimental
|
||||||
//~| HELP add #![feature(plugin_registrar)] to the crate attributes to enable
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
|
|
||||||
#[unsafe_destructor]
|
#[unsafe_destructor]
|
||||||
//~^ ERROR `#[unsafe_destructor]` does nothing anymore
|
//~^ ERROR `#[unsafe_destructor]` does nothing anymore
|
||||||
//~| HELP: add #![feature(unsafe_destructor)] to the crate attributes to enable
|
|
||||||
// (but of couse there is no point in doing so)
|
|
||||||
impl<'a> Drop for D<'a> {
|
impl<'a> Drop for D<'a> {
|
||||||
fn drop(&mut self) { }
|
fn drop(&mut self) { }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue