Skip to content

Commit aac6e31

Browse files
lpyalexcrichton
authored andcommitted
Remove remaining nolink usages.(fixes #12810)
1 parent 9959188 commit aac6e31

16 files changed

+1
-44
lines changed

src/doc/rust.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,6 @@ and are instead terminated by a semicolon.
14721472

14731473
~~~~
14741474
# use std::libc::{c_char, FILE};
1475-
# #[nolink]
14761475
14771476
extern {
14781477
fn fopen(filename: *c_char, mode: *c_char) -> *FILE;

src/libnative/io/file_win32.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ pub fn readdir(p: &CString) -> IoResult<~[Path]> {
335335
}).map(|path| root.join(path)).collect()
336336
}
337337

338-
#[nolink]
339338
extern {
340339
fn rust_list_dir_wfd_size() -> libc::size_t;
341340
fn rust_list_dir_wfd_fp_buf(wfd: *libc::c_void) -> *u16;

src/librustc/middle/lint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ static other_attrs: &'static [&'static str] = &[
979979
"macro_export", "must_use",
980980

981981
//mod-level
982-
"path", "link_name", "link_args", "nolink", "macro_escape", "no_implicit_prelude",
982+
"path", "link_name", "link_args", "macro_escape", "no_implicit_prelude",
983983

984984
// fn-level
985985
"test", "bench", "should_fail", "ignore", "inline", "lang", "main", "start",

src/libstd/io/test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ mod darwin_fd_limit {
150150
rlim_cur: rlim_t,
151151
rlim_max: rlim_t
152152
}
153-
#[nolink]
154153
extern {
155154
// name probably doesn't need to be mut, but the C function doesn't specify const
156155
fn sysctl(name: *mut libc::c_int, namelen: libc::c_uint,

src/libstd/libc.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3306,7 +3306,6 @@ pub mod funcs {
33063306
// or anything. The same is not true of POSIX.
33073307

33083308
pub mod c95 {
3309-
#[nolink]
33103309
pub mod ctype {
33113310
use libc::types::os::arch::c95::{c_char, c_int};
33123311

@@ -3327,7 +3326,6 @@ pub mod funcs {
33273326
}
33283327
}
33293328

3330-
#[nolink]
33313329
pub mod stdio {
33323330
use libc::types::common::c95::{FILE, c_void, fpos_t};
33333331
use libc::types::os::arch::c95::{c_char, c_int, c_long, size_t};
@@ -3383,7 +3381,6 @@ pub mod funcs {
33833381
}
33843382
}
33853383

3386-
#[nolink]
33873384
pub mod stdlib {
33883385
use libc::types::common::c95::c_void;
33893386
use libc::types::os::arch::c95::{c_char, c_double, c_int};
@@ -3416,7 +3413,6 @@ pub mod funcs {
34163413
}
34173414
}
34183415

3419-
#[nolink]
34203416
pub mod string {
34213417
use libc::types::common::c95::c_void;
34223418
use libc::types::os::arch::c95::{c_char, c_int, size_t};
@@ -3461,7 +3457,6 @@ pub mod funcs {
34613457

34623458
#[cfg(target_os = "win32")]
34633459
pub mod posix88 {
3464-
#[nolink]
34653460
pub mod stat_ {
34663461
use libc::types::os::common::posix01::{stat, utimbuf};
34673462
use libc::types::os::arch::c95::{c_int, c_char, wchar_t};
@@ -3486,7 +3481,6 @@ pub mod funcs {
34863481
}
34873482
}
34883483

3489-
#[nolink]
34903484
pub mod stdio {
34913485
use libc::types::common::c95::FILE;
34923486
use libc::types::os::arch::c95::{c_int, c_char};
@@ -3503,7 +3497,6 @@ pub mod funcs {
35033497
}
35043498
}
35053499

3506-
#[nolink]
35073500
pub mod fcntl {
35083501
use libc::types::os::arch::c95::{c_int, c_char, wchar_t};
35093502
extern {
@@ -3518,12 +3511,10 @@ pub mod funcs {
35183511
}
35193512
}
35203513

3521-
#[nolink]
35223514
pub mod dirent {
35233515
// Not supplied at all.
35243516
}
35253517

3526-
#[nolink]
35273518
pub mod unistd {
35283519
use libc::types::common::c95::c_void;
35293520
use libc::types::os::arch::c95::{c_int, c_uint, c_char,
@@ -3590,7 +3581,6 @@ pub mod funcs {
35903581
use libc::types::os::arch::posix01::stat;
35913582
use libc::types::os::arch::posix88::mode_t;
35923583

3593-
#[nolink]
35943584
extern {
35953585
pub fn chmod(path: *c_char, mode: mode_t) -> c_int;
35963586
pub fn fchmod(fd: c_int, mode: mode_t) -> c_int;
@@ -3618,7 +3608,6 @@ pub mod funcs {
36183608
}
36193609
}
36203610

3621-
#[nolink]
36223611
pub mod stdio {
36233612
use libc::types::common::c95::FILE;
36243613
use libc::types::os::arch::c95::{c_char, c_int};
@@ -3631,7 +3620,6 @@ pub mod funcs {
36313620
}
36323621
}
36333622

3634-
#[nolink]
36353623
pub mod fcntl {
36363624
use libc::types::os::arch::c95::{c_char, c_int};
36373625
use libc::types::os::arch::posix88::mode_t;
@@ -3644,7 +3632,6 @@ pub mod funcs {
36443632
}
36453633
}
36463634

3647-
#[nolink]
36483635
pub mod dirent {
36493636
use libc::types::common::posix88::{DIR, dirent_t};
36503637
use libc::types::os::arch::c95::{c_char, c_int, c_long};
@@ -3678,7 +3665,6 @@ pub mod funcs {
36783665
}
36793666
}
36803667

3681-
#[nolink]
36823668
pub mod unistd {
36833669
use libc::types::common::c95::c_void;
36843670
use libc::types::os::arch::c95::{c_char, c_int, c_long, c_uint};
@@ -3748,7 +3734,6 @@ pub mod funcs {
37483734
}
37493735
}
37503736

3751-
#[nolink]
37523737
pub mod signal {
37533738
use libc::types::os::arch::c95::{c_int};
37543739
use libc::types::os::arch::posix88::{pid_t};
@@ -3758,7 +3743,6 @@ pub mod funcs {
37583743
}
37593744
}
37603745

3761-
#[nolink]
37623746
pub mod mman {
37633747
use libc::types::common::c95::{c_void};
37643748
use libc::types::os::arch::c95::{size_t, c_int, c_char};
@@ -3796,7 +3780,6 @@ pub mod funcs {
37963780
#[cfg(target_os = "macos")]
37973781
#[cfg(target_os = "freebsd")]
37983782
pub mod posix01 {
3799-
#[nolink]
38003783
pub mod stat_ {
38013784
use libc::types::os::arch::c95::{c_char, c_int};
38023785
use libc::types::os::arch::posix01::stat;
@@ -3813,7 +3796,6 @@ pub mod funcs {
38133796
}
38143797
}
38153798

3816-
#[nolink]
38173799
pub mod unistd {
38183800
use libc::types::os::arch::c95::{c_char, c_int, size_t};
38193801
use libc::types::os::arch::posix88::{ssize_t, off_t};
@@ -3841,7 +3823,6 @@ pub mod funcs {
38413823
}
38423824
}
38433825

3844-
#[nolink]
38453826
pub mod wait {
38463827
use libc::types::os::arch::c95::{c_int};
38473828
use libc::types::os::arch::posix88::{pid_t};
@@ -3852,7 +3833,6 @@ pub mod funcs {
38523833
}
38533834
}
38543835

3855-
#[nolink]
38563836
pub mod glob {
38573837
use libc::types::os::arch::c95::{c_char, c_int};
38583838
use libc::types::os::common::posix01::{glob_t};
@@ -3867,7 +3847,6 @@ pub mod funcs {
38673847
}
38683848
}
38693849

3870-
#[nolink]
38713850
pub mod mman {
38723851
use libc::types::common::c95::{c_void};
38733852
use libc::types::os::arch::c95::{c_int, size_t};
@@ -4032,7 +4011,6 @@ pub mod funcs {
40324011
}
40334012

40344013
#[cfg(target_os = "macos")]
4035-
#[nolink]
40364014
pub mod extra {
40374015
use libc::types::os::arch::c95::{c_char, c_int};
40384016

@@ -4256,7 +4234,6 @@ pub mod funcs {
42564234
use libc::types::os::arch::c95::{c_int, c_long};
42574235
use libc::types::os::arch::c99::intptr_t;
42584236

4259-
#[nolink]
42604237
extern {
42614238
#[link_name = "_commit"]
42624239
pub fn commit(fd: c_int) -> c_int;

src/libstd/os.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,6 @@ pub fn errno() -> int {
615615
#[cfg(target_os = "macos")]
616616
#[cfg(target_os = "freebsd")]
617617
fn errno_location() -> *c_int {
618-
#[nolink]
619618
extern {
620619
fn __error() -> *c_int;
621620
}
@@ -627,7 +626,6 @@ pub fn errno() -> int {
627626
#[cfg(target_os = "linux")]
628627
#[cfg(target_os = "android")]
629628
fn errno_location() -> *c_int {
630-
#[nolink]
631629
extern {
632630
fn __errno_location() -> *c_int;
633631
}
@@ -665,7 +663,6 @@ pub fn last_os_error() -> ~str {
665663
#[cfg(target_os = "freebsd")]
666664
fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: libc::size_t)
667665
-> c_int {
668-
#[nolink]
669666
extern {
670667
fn strerror_r(errnum: c_int, buf: *mut c_char,
671668
buflen: libc::size_t) -> c_int;
@@ -681,7 +678,6 @@ pub fn last_os_error() -> ~str {
681678
#[cfg(target_os = "linux")]
682679
fn strerror_r(errnum: c_int, buf: *mut c_char,
683680
buflen: libc::size_t) -> c_int {
684-
#[nolink]
685681
extern {
686682
fn __xpg_strerror_r(errnum: c_int,
687683
buf: *mut c_char,

src/test/compile-fail/attrs-after-extern-mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
use std::libc;
1616

17-
#[nolink]
1817
extern {
1918
static mut rust_dbg_static_mut: libc::c_int;
2019
pub fn rust_dbg_static_mut_check_four();

src/test/compile-fail/lint-ctypes.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
use std::libc;
1414

15-
#[nolink]
1615
extern {
1716
pub fn bare_type1(size: int); //~ ERROR: found rust type
1817
pub fn bare_type2(size: uint); //~ ERROR: found rust type

src/test/compile-fail/nolink-with-link-args.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ the compiler output. */
1717
#[feature(link_args)];
1818

1919
#[link_args = "aFdEfSeVEEE"]
20-
#[nolink]
2120
extern {}
2221

2322
fn main() { }

src/test/run-pass/c-stack-returning-int64.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
mod libc {
1212
use std::libc::{c_char, c_long, c_longlong};
1313

14-
#[nolink]
1514
extern {
1615
pub fn atol(x: *c_char) -> c_long;
1716
pub fn atoll(x: *c_char) -> c_longlong;

src/test/run-pass/foreign-fn-linkname.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ extern crate extra;
1313
mod libc {
1414
use std::libc::{c_char, size_t};
1515

16-
#[nolink]
1716
extern {
1817
#[link_name = "strlen"]
1918
pub fn my_strlen(str: *c_char) -> size_t;

src/test/run-pass/foreign-mod-unused-const.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
mod foo {
1212
use std::libc::c_int;
1313

14-
#[nolink]
1514
extern {
1615
pub static errno: c_int;
1716
}

src/test/run-pass/foreign-struct.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pub enum void { }
1515
mod bindgen {
1616
use super::void;
1717

18-
#[nolink]
1918
extern {
2019
pub fn printf(v: void);
2120
}

src/test/run-pass/foreign2.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,22 @@
99
// except according to those terms.
1010

1111
mod bar {
12-
#[nolink]
1312
extern {}
1413
}
1514

1615
mod zed {
17-
#[nolink]
1816
extern {}
1917
}
2018

2119
mod libc {
2220
use std::libc::{c_int, c_void, size_t, ssize_t};
2321

24-
#[nolink]
2522
extern {
2623
pub fn write(fd: c_int, buf: *c_void, count: size_t) -> ssize_t;
2724
}
2825
}
2926

3027
mod baz {
31-
#[nolink]
3228
extern {}
3329
}
3430

src/test/run-pass/nil-decl-in-foreign.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// Issue #901
1212
mod libc {
13-
#[nolink]
1413
extern {
1514
pub fn printf(x: ());
1615
}

src/test/run-pass/warn-ctypes-inhibit.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#[allow(ctypes)];
1414

1515
mod libc {
16-
#[nolink]
1716
extern {
1817
pub fn malloc(size: int) -> *u8;
1918
}

0 commit comments

Comments
 (0)