Skip to content

Commit 9432e2a

Browse files
committed
rustc: Update obsolete attribute list
1 parent b4ad336 commit 9432e2a

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/librustc/middle/lint.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -807,9 +807,12 @@ fn check_attrs_usage(cx: &Context, attrs: &[ast::Attribute]) {
807807
];
808808

809809
let obsolete_attrs = [
810-
("abi", "extern \"abi\" fn"),
811-
("auto_encode", "#[deriving(Encodable)]"),
812-
("auto_decode", "#[deriving(Decodable)]"),
810+
("abi", "Use `extern \"abi\" fn` instead"),
811+
("auto_encode", "Use `#[deriving(Encodable)]` instead"),
812+
("auto_decode", "Use `#[deriving(Decodable)]` instead"),
813+
("fast_ffi", "Remove it"),
814+
("fixed_stack_segment", "Remove it"),
815+
("rust_stack", "Remove it"),
813816
];
814817

815818
let other_attrs = [
@@ -826,7 +829,7 @@ fn check_attrs_usage(cx: &Context, attrs: &[ast::Attribute]) {
826829

827830
// fn-level
828831
"test", "bench", "should_fail", "ignore", "inline", "lang", "main", "start",
829-
"fixed_stack_segment", "no_split_stack", "rust_stack", "cold",
832+
"no_split_stack", "cold",
830833

831834
// internal attribute: bypass privacy inside items
832835
"!resolve_unexported",
@@ -849,7 +852,7 @@ fn check_attrs_usage(cx: &Context, attrs: &[ast::Attribute]) {
849852
for &(obs_attr, obs_alter) in obsolete_attrs.iter() {
850853
if name.equiv(&obs_attr) {
851854
cx.span_lint(attribute_usage, attr.span,
852-
format!("obsolete attribute: use `{:s}` instead", obs_alter));
855+
format!("obsolete attribute: {:s}", obs_alter));
853856
return;
854857
}
855858
}

src/librustpkg/path_util.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,6 @@ pub fn versionize(p: &Path, v: &Version) -> Path {
461461
}
462462

463463
#[cfg(target_os = "win32")]
464-
#[fixed_stack_segment]
465464
pub fn chmod_read_only(p: &Path) -> bool {
466465
unsafe {
467466
do p.with_c_str |src_buf| {
@@ -471,7 +470,6 @@ pub fn chmod_read_only(p: &Path) -> bool {
471470
}
472471

473472
#[cfg(not(target_os = "win32"))]
474-
#[fixed_stack_segment]
475473
pub fn chmod_read_only(p: &Path) -> bool {
476474
unsafe {
477475
do p.with_c_str |src_buf| {

src/test/compile-fail/cast-to-bare-fn.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
fn foo(_x: int) { }
1212

13-
#[fixed_stack_segment]
1413
fn main() {
1514
let v: u64 = 5;
1615
let x = foo as extern "C" fn() -> int;

src/test/compile-fail/lint-obsolete-attr.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@
1515

1616
#[abi="stdcall"] extern {} //~ ERROR: obsolete attribute
1717

18+
#[fixed_stack_segment] fn f() {} //~ ERROR: obsolete attribute
19+
1820
fn main() {}

0 commit comments

Comments
 (0)