about summary refs log tree commit diff
diff options
context:
space:
mode:
authorklutzy <klutzytheklutzy@gmail.com>2013-11-25 23:17:01 +0900
committerklutzy <klutzytheklutzy@gmail.com>2013-11-26 14:06:52 +0900
commit9432e2a25dc5f3a71aa4f95a9dd6ba17198c79bd (patch)
tree8a83cca9c1040a0fd9b2d81cb97424dd97146215
parentb4ad3363f3ce5facdaac7384892319914f119177 (diff)
downloadrust-9432e2a25dc5f3a71aa4f95a9dd6ba17198c79bd.tar.gz
rust-9432e2a25dc5f3a71aa4f95a9dd6ba17198c79bd.zip
rustc: Update obsolete attribute list
-rw-r--r--src/librustc/middle/lint.rs13
-rw-r--r--src/librustpkg/path_util.rs2
-rw-r--r--src/test/compile-fail/cast-to-bare-fn.rs1
-rw-r--r--src/test/compile-fail/lint-obsolete-attr.rs2
4 files changed, 10 insertions, 8 deletions
diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs
index 03563c596fb..42dbe3f6d9e 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 921005fdaab..bce41e5a49f 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 8d75c66cb82..10a829fd794 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 2a0ffe80ab8..91976978315 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() {}