diff --git a/src/doc/rust.md b/src/doc/rust.md index d1cef9a061477..9e2b934d0abc4 100644 --- a/src/doc/rust.md +++ b/src/doc/rust.md @@ -1472,7 +1472,6 @@ and are instead terminated by a semicolon. ~~~~ # use std::libc::{c_char, FILE}; -# #[nolink] extern { fn fopen(filename: *c_char, mode: *c_char) -> *FILE; diff --git a/src/libnative/io/file_win32.rs b/src/libnative/io/file_win32.rs index e880bd05cf7fc..8f4f9259ab7ac 100644 --- a/src/libnative/io/file_win32.rs +++ b/src/libnative/io/file_win32.rs @@ -335,7 +335,6 @@ pub fn readdir(p: &CString) -> IoResult<~[Path]> { }).map(|path| root.join(path)).collect() } - #[nolink] extern { fn rust_list_dir_wfd_size() -> libc::size_t; fn rust_list_dir_wfd_fp_buf(wfd: *libc::c_void) -> *u16; diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index ddf75d1f0b652..38e89dd99146c 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -979,7 +979,7 @@ static other_attrs: &'static [&'static str] = &[ "macro_export", "must_use", //mod-level - "path", "link_name", "link_args", "nolink", "macro_escape", "no_implicit_prelude", + "path", "link_name", "link_args", "macro_escape", "no_implicit_prelude", // fn-level "test", "bench", "should_fail", "ignore", "inline", "lang", "main", "start", diff --git a/src/libstd/io/test.rs b/src/libstd/io/test.rs index b491891ff59df..6c8ccc0ce5dc0 100644 --- a/src/libstd/io/test.rs +++ b/src/libstd/io/test.rs @@ -143,7 +143,6 @@ mod darwin_fd_limit { rlim_cur: rlim_t, rlim_max: rlim_t } - #[nolink] extern { // name probably doesn't need to be mut, but the C function doesn't specify const fn sysctl(name: *mut libc::c_int, namelen: libc::c_uint, diff --git a/src/libstd/libc.rs b/src/libstd/libc.rs index afd524e9d7afe..c602c2fc27f8e 100644 --- a/src/libstd/libc.rs +++ b/src/libstd/libc.rs @@ -3306,7 +3306,6 @@ pub mod funcs { // or anything. The same is not true of POSIX. pub mod c95 { - #[nolink] pub mod ctype { use libc::types::os::arch::c95::{c_char, c_int}; @@ -3327,7 +3326,6 @@ pub mod funcs { } } - #[nolink] pub mod stdio { use libc::types::common::c95::{FILE, c_void, fpos_t}; use libc::types::os::arch::c95::{c_char, c_int, c_long, size_t}; @@ -3383,7 +3381,6 @@ pub mod funcs { } } - #[nolink] pub mod stdlib { use libc::types::common::c95::c_void; use libc::types::os::arch::c95::{c_char, c_double, c_int}; @@ -3416,7 +3413,6 @@ pub mod funcs { } } - #[nolink] pub mod string { use libc::types::common::c95::c_void; use libc::types::os::arch::c95::{c_char, c_int, size_t}; @@ -3461,7 +3457,6 @@ pub mod funcs { #[cfg(target_os = "win32")] pub mod posix88 { - #[nolink] pub mod stat_ { use libc::types::os::common::posix01::{stat, utimbuf}; use libc::types::os::arch::c95::{c_int, c_char, wchar_t}; @@ -3486,7 +3481,6 @@ pub mod funcs { } } - #[nolink] pub mod stdio { use libc::types::common::c95::FILE; use libc::types::os::arch::c95::{c_int, c_char}; @@ -3503,7 +3497,6 @@ pub mod funcs { } } - #[nolink] pub mod fcntl { use libc::types::os::arch::c95::{c_int, c_char, wchar_t}; extern { @@ -3518,12 +3511,10 @@ pub mod funcs { } } - #[nolink] pub mod dirent { // Not supplied at all. } - #[nolink] pub mod unistd { use libc::types::common::c95::c_void; use libc::types::os::arch::c95::{c_int, c_uint, c_char, @@ -3590,7 +3581,6 @@ pub mod funcs { use libc::types::os::arch::posix01::stat; use libc::types::os::arch::posix88::mode_t; - #[nolink] extern { pub fn chmod(path: *c_char, mode: mode_t) -> c_int; pub fn fchmod(fd: c_int, mode: mode_t) -> c_int; @@ -3618,7 +3608,6 @@ pub mod funcs { } } - #[nolink] pub mod stdio { use libc::types::common::c95::FILE; use libc::types::os::arch::c95::{c_char, c_int}; @@ -3631,7 +3620,6 @@ pub mod funcs { } } - #[nolink] pub mod fcntl { use libc::types::os::arch::c95::{c_char, c_int}; use libc::types::os::arch::posix88::mode_t; @@ -3644,7 +3632,6 @@ pub mod funcs { } } - #[nolink] pub mod dirent { use libc::types::common::posix88::{DIR, dirent_t}; use libc::types::os::arch::c95::{c_char, c_int, c_long}; @@ -3678,7 +3665,6 @@ pub mod funcs { } } - #[nolink] pub mod unistd { use libc::types::common::c95::c_void; use libc::types::os::arch::c95::{c_char, c_int, c_long, c_uint}; @@ -3748,7 +3734,6 @@ pub mod funcs { } } - #[nolink] pub mod signal { use libc::types::os::arch::c95::{c_int}; use libc::types::os::arch::posix88::{pid_t}; @@ -3758,7 +3743,6 @@ pub mod funcs { } } - #[nolink] pub mod mman { use libc::types::common::c95::{c_void}; use libc::types::os::arch::c95::{size_t, c_int, c_char}; @@ -3796,7 +3780,6 @@ pub mod funcs { #[cfg(target_os = "macos")] #[cfg(target_os = "freebsd")] pub mod posix01 { - #[nolink] pub mod stat_ { use libc::types::os::arch::c95::{c_char, c_int}; use libc::types::os::arch::posix01::stat; @@ -3813,7 +3796,6 @@ pub mod funcs { } } - #[nolink] pub mod unistd { use libc::types::os::arch::c95::{c_char, c_int, size_t}; use libc::types::os::arch::posix88::{ssize_t, off_t}; @@ -3841,7 +3823,6 @@ pub mod funcs { } } - #[nolink] pub mod wait { use libc::types::os::arch::c95::{c_int}; use libc::types::os::arch::posix88::{pid_t}; @@ -3852,7 +3833,6 @@ pub mod funcs { } } - #[nolink] pub mod glob { use libc::types::os::arch::c95::{c_char, c_int}; use libc::types::os::common::posix01::{glob_t}; @@ -3867,7 +3847,6 @@ pub mod funcs { } } - #[nolink] pub mod mman { use libc::types::common::c95::{c_void}; use libc::types::os::arch::c95::{c_int, size_t}; @@ -4032,7 +4011,6 @@ pub mod funcs { } #[cfg(target_os = "macos")] - #[nolink] pub mod extra { use libc::types::os::arch::c95::{c_char, c_int}; @@ -4256,7 +4234,6 @@ pub mod funcs { use libc::types::os::arch::c95::{c_int, c_long}; use libc::types::os::arch::c99::intptr_t; - #[nolink] extern { #[link_name = "_commit"] pub fn commit(fd: c_int) -> c_int; diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 8efa9763ba9ff..2478ae494aba9 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -615,7 +615,6 @@ pub fn errno() -> int { #[cfg(target_os = "macos")] #[cfg(target_os = "freebsd")] fn errno_location() -> *c_int { - #[nolink] extern { fn __error() -> *c_int; } @@ -627,7 +626,6 @@ pub fn errno() -> int { #[cfg(target_os = "linux")] #[cfg(target_os = "android")] fn errno_location() -> *c_int { - #[nolink] extern { fn __errno_location() -> *c_int; } @@ -665,7 +663,6 @@ pub fn last_os_error() -> ~str { #[cfg(target_os = "freebsd")] fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: libc::size_t) -> c_int { - #[nolink] extern { fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: libc::size_t) -> c_int; @@ -681,7 +678,6 @@ pub fn last_os_error() -> ~str { #[cfg(target_os = "linux")] fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: libc::size_t) -> c_int { - #[nolink] extern { fn __xpg_strerror_r(errnum: c_int, buf: *mut c_char, diff --git a/src/test/compile-fail/attrs-after-extern-mod.rs b/src/test/compile-fail/attrs-after-extern-mod.rs index 3102fb2664f7d..44b6ecdee7073 100644 --- a/src/test/compile-fail/attrs-after-extern-mod.rs +++ b/src/test/compile-fail/attrs-after-extern-mod.rs @@ -14,7 +14,6 @@ use std::libc; -#[nolink] extern { static mut rust_dbg_static_mut: libc::c_int; pub fn rust_dbg_static_mut_check_four(); diff --git a/src/test/compile-fail/lint-ctypes.rs b/src/test/compile-fail/lint-ctypes.rs index a0c027b2d6b3f..0a1b78c8d5d0a 100644 --- a/src/test/compile-fail/lint-ctypes.rs +++ b/src/test/compile-fail/lint-ctypes.rs @@ -12,7 +12,6 @@ use std::libc; -#[nolink] extern { pub fn bare_type1(size: int); //~ ERROR: found rust type pub fn bare_type2(size: uint); //~ ERROR: found rust type diff --git a/src/test/compile-fail/nolink-with-link-args.rs b/src/test/compile-fail/nolink-with-link-args.rs index a1603ee945316..de929b8bfc923 100644 --- a/src/test/compile-fail/nolink-with-link-args.rs +++ b/src/test/compile-fail/nolink-with-link-args.rs @@ -17,7 +17,6 @@ the compiler output. */ #[feature(link_args)]; #[link_args = "aFdEfSeVEEE"] -#[nolink] extern {} fn main() { } diff --git a/src/test/run-pass/c-stack-returning-int64.rs b/src/test/run-pass/c-stack-returning-int64.rs index 940f62789bbc3..9a02768faebe1 100644 --- a/src/test/run-pass/c-stack-returning-int64.rs +++ b/src/test/run-pass/c-stack-returning-int64.rs @@ -11,7 +11,6 @@ mod libc { use std::libc::{c_char, c_long, c_longlong}; - #[nolink] extern { pub fn atol(x: *c_char) -> c_long; pub fn atoll(x: *c_char) -> c_longlong; diff --git a/src/test/run-pass/foreign-fn-linkname.rs b/src/test/run-pass/foreign-fn-linkname.rs index b9d8d622731d3..7e480f1c32b50 100644 --- a/src/test/run-pass/foreign-fn-linkname.rs +++ b/src/test/run-pass/foreign-fn-linkname.rs @@ -13,7 +13,6 @@ extern crate extra; mod libc { use std::libc::{c_char, size_t}; - #[nolink] extern { #[link_name = "strlen"] pub fn my_strlen(str: *c_char) -> size_t; diff --git a/src/test/run-pass/foreign-mod-unused-const.rs b/src/test/run-pass/foreign-mod-unused-const.rs index 977488d4529af..2f58765394131 100644 --- a/src/test/run-pass/foreign-mod-unused-const.rs +++ b/src/test/run-pass/foreign-mod-unused-const.rs @@ -11,7 +11,6 @@ mod foo { use std::libc::c_int; - #[nolink] extern { pub static errno: c_int; } diff --git a/src/test/run-pass/foreign-struct.rs b/src/test/run-pass/foreign-struct.rs index a70fec9265942..e242071fb26bc 100644 --- a/src/test/run-pass/foreign-struct.rs +++ b/src/test/run-pass/foreign-struct.rs @@ -15,7 +15,6 @@ pub enum void { } mod bindgen { use super::void; - #[nolink] extern { pub fn printf(v: void); } diff --git a/src/test/run-pass/foreign2.rs b/src/test/run-pass/foreign2.rs index 350a3d6f4fc29..7c9d2dfa87cd1 100644 --- a/src/test/run-pass/foreign2.rs +++ b/src/test/run-pass/foreign2.rs @@ -9,26 +9,22 @@ // except according to those terms. mod bar { - #[nolink] extern {} } mod zed { - #[nolink] extern {} } mod libc { use std::libc::{c_int, c_void, size_t, ssize_t}; - #[nolink] extern { pub fn write(fd: c_int, buf: *c_void, count: size_t) -> ssize_t; } } mod baz { - #[nolink] extern {} } diff --git a/src/test/run-pass/nil-decl-in-foreign.rs b/src/test/run-pass/nil-decl-in-foreign.rs index 15795f954b8e7..e23c970e29a58 100644 --- a/src/test/run-pass/nil-decl-in-foreign.rs +++ b/src/test/run-pass/nil-decl-in-foreign.rs @@ -10,7 +10,6 @@ // Issue #901 mod libc { - #[nolink] extern { pub fn printf(x: ()); } diff --git a/src/test/run-pass/warn-ctypes-inhibit.rs b/src/test/run-pass/warn-ctypes-inhibit.rs index f2cc2d79a946e..30ce77153116f 100644 --- a/src/test/run-pass/warn-ctypes-inhibit.rs +++ b/src/test/run-pass/warn-ctypes-inhibit.rs @@ -13,7 +13,6 @@ #[allow(ctypes)]; mod libc { - #[nolink] extern { pub fn malloc(size: int) -> *u8; }