Make stability attributes an error. #22830
This commit is contained in:
parent
f46c4e158d
commit
bb407b1e9d
3 changed files with 8 additions and 11 deletions
|
@ -95,9 +95,9 @@ impl<'a> Annotator<'a> {
|
||||||
let tag = attr.name();
|
let tag = attr.name();
|
||||||
if tag == "unstable" || tag == "stable" || tag == "deprecated" {
|
if tag == "unstable" || tag == "stable" || tag == "deprecated" {
|
||||||
attr::mark_used(attr);
|
attr::mark_used(attr);
|
||||||
self.sess.span_warn(attr.span(),
|
self.sess.span_err(attr.span(),
|
||||||
"stability attributes are deprecated \
|
"stability attributes may not be used outside \
|
||||||
and will soon become errors");
|
of the standard library");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
f(self);
|
f(self);
|
||||||
|
|
|
@ -22,11 +22,12 @@
|
||||||
#![unstable(feature = "rustc_private")]
|
#![unstable(feature = "rustc_private")]
|
||||||
#![crate_type = "dylib"]
|
#![crate_type = "dylib"]
|
||||||
#![crate_type = "rlib"]
|
#![crate_type = "rlib"]
|
||||||
|
#![staged_api]
|
||||||
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
|
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
|
||||||
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
|
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
|
||||||
html_root_url = "http://doc.rust-lang.org/nightly/")]
|
html_root_url = "http://doc.rust-lang.org/nightly/")]
|
||||||
|
|
||||||
#![feature(rustc_private)]
|
#![feature(rustc_private, staged_api)]
|
||||||
#![cfg_attr(test, feature(test))]
|
#![cfg_attr(test, feature(test))]
|
||||||
|
|
||||||
#[macro_use] extern crate log;
|
#[macro_use] extern crate log;
|
||||||
|
|
|
@ -8,11 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// These two generate an error to satisfy the compile-fail test
|
#[unstable] //~ ERROR: stability attributes may not be used
|
||||||
#![deny(warnings)]
|
#[stable] //~ ERROR: stability attributes may not be used
|
||||||
#![feature(blah)] //~ ERROR
|
#[deprecated] //~ ERROR: stability attributes may not be used
|
||||||
|
|
||||||
#[unstable] //~ WARNING: stability attributes are deprecated
|
|
||||||
#[stable] //~ WARNING: stability attributes are deprecated
|
|
||||||
#[deprecated] //~ WARNING: stability attributes are deprecated
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
Loading…
Reference in a new issue