rustc: Update obsolete attribute list

This commit is contained in:
klutzy 2013-11-25 23:17:01 +09:00
parent b4ad3363f3
commit 9432e2a25d
4 changed files with 10 additions and 8 deletions

View File

@ -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;
}
}

View File

@ -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| {

View File

@ -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;

View File

@ -15,4 +15,6 @@
#[abi="stdcall"] extern {} //~ ERROR: obsolete attribute
#[fixed_stack_segment] fn f() {} //~ ERROR: obsolete attribute
fn main() {}