From 9432e2a25dc5f3a71aa4f95a9dd6ba17198c79bd Mon Sep 17 00:00:00 2001 From: klutzy Date: Mon, 25 Nov 2013 23:17:01 +0900 Subject: [PATCH] rustc: Update obsolete attribute list --- src/librustc/middle/lint.rs | 13 ++++++++----- src/librustpkg/path_util.rs | 2 -- src/test/compile-fail/cast-to-bare-fn.rs | 1 - src/test/compile-fail/lint-obsolete-attr.rs | 2 ++ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index 03563c596fb35..42dbe3f6d9ecb 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -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 = [ @@ -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", @@ -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; } } diff --git a/src/librustpkg/path_util.rs b/src/librustpkg/path_util.rs index 921005fdaab57..bce41e5a49fe0 100644 --- a/src/librustpkg/path_util.rs +++ b/src/librustpkg/path_util.rs @@ -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| { @@ -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| { diff --git a/src/test/compile-fail/cast-to-bare-fn.rs b/src/test/compile-fail/cast-to-bare-fn.rs index 8d75c66cb8274..10a829fd79455 100644 --- a/src/test/compile-fail/cast-to-bare-fn.rs +++ b/src/test/compile-fail/cast-to-bare-fn.rs @@ -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; diff --git a/src/test/compile-fail/lint-obsolete-attr.rs b/src/test/compile-fail/lint-obsolete-attr.rs index 2a0ffe80ab804..919769783152d 100644 --- a/src/test/compile-fail/lint-obsolete-attr.rs +++ b/src/test/compile-fail/lint-obsolete-attr.rs @@ -15,4 +15,6 @@ #[abi="stdcall"] extern {} //~ ERROR: obsolete attribute +#[fixed_stack_segment] fn f() {} //~ ERROR: obsolete attribute + fn main() {}