Skip to content

Commit e22e96c

Browse files
committed
Make stability attributes an error. #22830
1 parent f46c4e1 commit e22e96c

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/librustc/middle/stability.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ impl<'a> Annotator<'a> {
9595
let tag = attr.name();
9696
if tag == "unstable" || tag == "stable" || tag == "deprecated" {
9797
attr::mark_used(attr);
98-
self.sess.span_warn(attr.span(),
99-
"stability attributes are deprecated \
100-
and will soon become errors");
98+
self.sess.span_err(attr.span(),
99+
"stability attributes may not be used outside \
100+
of the standard library");
101101
}
102102
}
103103
f(self);

src/test/compile-fail/stability-attribute-non-staged.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// These two generate an error to satisfy the compile-fail test
12-
#![deny(warnings)]
13-
#![feature(blah)] //~ ERROR
14-
15-
#[unstable] //~ WARNING: stability attributes are deprecated
16-
#[stable] //~ WARNING: stability attributes are deprecated
17-
#[deprecated] //~ WARNING: stability attributes are deprecated
11+
#[unstable] //~ WARNING: stability attributes may not be used
12+
#[stable] //~ WARNING: stability attributes may not be used
13+
#[deprecated] //~ WARNING: stability attributes may not be used
1814
fn main() { }

0 commit comments

Comments
 (0)