diff options
| author | Brian Anderson <banderson@mozilla.com> | 2015-04-20 17:00:35 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2015-04-20 17:33:31 -0700 |
| commit | bb407b1e9db575fc04f59addcb9ba04076d8206b (patch) | |
| tree | 6e9e86c1c62ce206ddc05b0de2b7eeddb371d240 /src | |
| parent | f46c4e158d395cf6e186bf6afdf1705c12071cbe (diff) | |
| download | rust-bb407b1e9db575fc04f59addcb9ba04076d8206b.tar.gz rust-bb407b1e9db575fc04f59addcb9ba04076d8206b.zip | |
Make stability attributes an error. #22830
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/middle/stability.rs | 6 | ||||
| -rw-r--r-- | src/librustc_data_structures/lib.rs | 3 | ||||
| -rw-r--r-- | src/test/compile-fail/stability-attribute-non-staged.rs | 10 |
3 files changed, 8 insertions, 11 deletions
diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs index e7c25d82150..d75dc861e83 100644 --- a/src/librustc/middle/stability.rs +++ b/src/librustc/middle/stability.rs @@ -95,9 +95,9 @@ impl<'a> Annotator<'a> { let tag = attr.name(); if tag == "unstable" || tag == "stable" || tag == "deprecated" { attr::mark_used(attr); - self.sess.span_warn(attr.span(), - "stability attributes are deprecated \ - and will soon become errors"); + self.sess.span_err(attr.span(), + "stability attributes may not be used outside \ + of the standard library"); } } f(self); diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs index dc376deebc1..1f8f7694ff9 100644 --- a/src/librustc_data_structures/lib.rs +++ b/src/librustc_data_structures/lib.rs @@ -22,11 +22,12 @@ #![unstable(feature = "rustc_private")] #![crate_type = "dylib"] #![crate_type = "rlib"] +#![staged_api] #![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_root_url = "http://doc.rust-lang.org/nightly/")] -#![feature(rustc_private)] +#![feature(rustc_private, staged_api)] #![cfg_attr(test, feature(test))] #[macro_use] extern crate log; diff --git a/src/test/compile-fail/stability-attribute-non-staged.rs b/src/test/compile-fail/stability-attribute-non-staged.rs index db16e7c0138..b0efdfd1818 100644 --- a/src/test/compile-fail/stability-attribute-non-staged.rs +++ b/src/test/compile-fail/stability-attribute-non-staged.rs @@ -8,11 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// These two generate an error to satisfy the compile-fail test -#![deny(warnings)] -#![feature(blah)] //~ ERROR - -#[unstable] //~ WARNING: stability attributes are deprecated -#[stable] //~ WARNING: stability attributes are deprecated -#[deprecated] //~ WARNING: stability attributes are deprecated +#[unstable] //~ ERROR: stability attributes may not be used +#[stable] //~ ERROR: stability attributes may not be used +#[deprecated] //~ ERROR: stability attributes may not be used fn main() { } |
