Skip to content

Commit

Permalink
rustc: Update obsolete attribute list
Browse files Browse the repository at this point in the history
  • Loading branch information
klutzy committed Nov 26, 2013
1 parent b4ad336 commit 9432e2a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
13 changes: 8 additions & 5 deletions src/librustc/middle/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,12 @@ fn check_attrs_usage(cx: &Context, attrs: &[ast::Attribute]) {
];

let obsolete_attrs = [
("abi", "extern \"abi\" fn"),
("auto_encode", "#[deriving(Encodable)]"),
("auto_decode", "#[deriving(Decodable)]"),
("abi", "Use `extern \"abi\" fn` instead"),
("auto_encode", "Use `#[deriving(Encodable)]` instead"),
("auto_decode", "Use `#[deriving(Decodable)]` instead"),
("fast_ffi", "Remove it"),
("fixed_stack_segment", "Remove it"),
("rust_stack", "Remove it"),
];

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

// fn-level
"test", "bench", "should_fail", "ignore", "inline", "lang", "main", "start",
"fixed_stack_segment", "no_split_stack", "rust_stack", "cold",
"no_split_stack", "cold",

// internal attribute: bypass privacy inside items
"!resolve_unexported",
Expand All @@ -849,7 +852,7 @@ fn check_attrs_usage(cx: &Context, attrs: &[ast::Attribute]) {
for &(obs_attr, obs_alter) in obsolete_attrs.iter() {
if name.equiv(&obs_attr) {
cx.span_lint(attribute_usage, attr.span,
format!("obsolete attribute: use `{:s}` instead", obs_alter));
format!("obsolete attribute: {:s}", obs_alter));
return;
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/librustpkg/path_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ pub fn versionize(p: &Path, v: &Version) -> Path {
}

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

#[cfg(not(target_os = "win32"))]
#[fixed_stack_segment]
pub fn chmod_read_only(p: &Path) -> bool {
unsafe {
do p.with_c_str |src_buf| {
Expand Down
1 change: 0 additions & 1 deletion src/test/compile-fail/cast-to-bare-fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

fn foo(_x: int) { }

#[fixed_stack_segment]
fn main() {
let v: u64 = 5;
let x = foo as extern "C" fn() -> int;
Expand Down
2 changes: 2 additions & 0 deletions src/test/compile-fail/lint-obsolete-attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@

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

#[fixed_stack_segment] fn f() {} //~ ERROR: obsolete attribute

fn main() {}

0 comments on commit 9432e2a

Please sign in to comment.