Skip to content

Commit 5c9ca33

Browse files
committed
---
yaml --- r: 46846 b: refs/heads/auto c: 6b5d1af h: refs/heads/master v: v3
1 parent 60a585a commit 5c9ca33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1624
-1368
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 87e44af2f2731ea59207aef456caa391ef230645
17+
refs/heads/auto: 6b5d1afeec9ca48c224a8c69d1d3515edf9b1108

branches/auto/src/libcore/libc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,8 +1139,8 @@ pub mod funcs {
11391139
unsafe fn strxfrm(s: *c_char, ct: *c_char, n: size_t)
11401140
-> size_t;
11411141

1142-
// These are fine to execute on the Rust stack. They must be, in
1143-
// fact, because LLVM generates calls to them!
1142+
// These are fine to execute on the Rust stack. They must be,
1143+
// in fact, because LLVM generates calls to them!
11441144
#[rust_stack]
11451145
#[inline(always)]
11461146
unsafe fn memcpy(s: *c_void, ct: *c_void, n: size_t)

branches/auto/src/librustc/back/link.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,12 @@ pub mod jit {
9494
use core::ptr;
9595
use core::str;
9696

97-
#[nolink]
98-
#[abi = "rust-intrinsic"]
99-
pub extern mod rusti {
100-
pub fn morestack_addr() -> *();
97+
pub mod rusti {
98+
#[nolink]
99+
#[abi = "rust-intrinsic"]
100+
pub extern {
101+
pub fn morestack_addr() -> *();
102+
}
101103
}
102104

103105
pub struct Closure {

branches/auto/src/librustc/front/intrinsic.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,13 @@ pub mod intrinsic {
122122
fn visit_closure_ptr(&self, ck: uint) -> bool;
123123
}
124124

125-
#[abi = "rust-intrinsic"]
126-
pub extern mod rusti {
127-
pub fn get_tydesc<T>() -> *();
128-
pub fn visit_tydesc(++td: *TyDesc, &&tv: TyVisitor);
125+
pub mod rusti {
126+
use super::{TyDesc, TyVisitor};
127+
128+
#[abi = "rust-intrinsic"]
129+
pub extern {
130+
pub fn get_tydesc<T>() -> *();
131+
pub fn visit_tydesc(++td: *TyDesc, &&tv: TyVisitor);
132+
}
129133
}
130134
}

branches/auto/src/librustc/lib/llvm.rs

Lines changed: 1164 additions & 1003 deletions
Large diffs are not rendered by default.

branches/auto/src/librustdoc/attr_pass.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,9 @@ fn should_extract_top_mod_attributes() {
135135
assert doc.cratemod().desc() == Some(~"test");
136136
}
137137
138-
#[test]
139-
fn should_extract_foreign_mod_attributes() {
140-
let doc = test::mk_doc(~"#[doc = \"test\"] extern mod a { }");
141-
assert doc.cratemod().nmods()[0].desc() == Some(~"test");
142-
}
143-
144138
#[test]
145139
fn should_extract_foreign_fn_attributes() {
146-
let doc = test::mk_doc(~"extern mod a { #[doc = \"test\"] fn a(); }");
140+
let doc = test::mk_doc(~"extern { #[doc = \"test\"] fn a(); }");
147141
assert doc.cratemod().nmods()[0].fns[0].desc() == Some(~"test");
148142
}
149143

branches/auto/src/librustdoc/extract.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -371,15 +371,9 @@ mod test {
371371
assert doc.cratemod().mods()[0].mods()[1].name() == ~"c";
372372
}
373373
374-
#[test]
375-
pub fn extract_foreign_mods() {
376-
let doc = mk_doc(~"extern mod a { }");
377-
assert doc.cratemod().nmods()[0].name() == ~"a";
378-
}
379-
380374
#[test]
381375
pub fn extract_fns_from_foreign_mods() {
382-
let doc = mk_doc(~"extern mod a { fn a(); }");
376+
let doc = mk_doc(~"extern { fn a(); }");
383377
assert doc.cratemod().nmods()[0].fns[0].name() == ~"a";
384378
}
385379

branches/auto/src/librustdoc/page_pass.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,18 +169,6 @@ fn should_remove_mods_from_containing_mods() {
169169
assert vec::is_empty(doc.cratemod().mods());
170170
}
171171

172-
#[test]
173-
fn should_make_a_page_for_every_foreign_mod() {
174-
let doc = test::mk_doc(~"extern mod a { }");
175-
assert doc.pages.nmods()[0].name() == ~"a";
176-
}
177-
178-
#[test]
179-
fn should_remove_foreign_mods_from_containing_mods() {
180-
let doc = test::mk_doc(~"extern mod a { }");
181-
assert vec::is_empty(doc.cratemod().nmods());
182-
}
183-
184172
#[cfg(test)]
185173
mod test {
186174
use astsrv;

branches/auto/src/librustdoc/path_pass.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -115,22 +115,3 @@ fn should_record_fn_paths() {
115115
}
116116
}
117117

118-
#[test]
119-
fn should_record_foreign_mod_paths() {
120-
let source = ~"mod a { extern mod b { } }";
121-
do astsrv::from_str(source) |srv| {
122-
let doc = extract::from_srv(srv.clone(), ~"");
123-
let doc = run(srv.clone(), doc);
124-
assert doc.cratemod().mods()[0].nmods()[0].path() == ~[~"a"];
125-
}
126-
}
127-
128-
#[test]
129-
fn should_record_foreign_fn_paths() {
130-
let source = ~"extern mod a { fn b(); }";
131-
do astsrv::from_str(source) |srv| {
132-
let doc = extract::from_srv(srv.clone(), ~"");
133-
let doc = run(srv.clone(), doc);
134-
assert doc.cratemod().nmods()[0].fns[0].path() == ~[~"a"];
135-
}
136-
}

branches/auto/src/libstd/uv_ll.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -786,9 +786,11 @@ pub mod rustrt {
786786
unsafe fn rust_uv_tcp_bind6(tcp_server: *uv_tcp_t,
787787
++addr: *sockaddr_in6) -> libc::c_int;
788788
unsafe fn rust_uv_tcp_getpeername(tcp_handle_ptr: *uv_tcp_t,
789-
++name: *sockaddr_in) -> libc::c_int;
789+
++name: *sockaddr_in)
790+
-> libc::c_int;
790791
unsafe fn rust_uv_tcp_getpeername6(tcp_handle_ptr: *uv_tcp_t,
791-
++name: *sockaddr_in6) ->libc::c_int;
792+
++name: *sockaddr_in6)
793+
-> libc::c_int;
792794
unsafe fn rust_uv_listen(stream: *libc::c_void,
793795
backlog: libc::c_int,
794796
cb: *u8) -> libc::c_int;
@@ -852,7 +854,8 @@ pub mod rustrt {
852854
-> *libc::c_void;
853855
unsafe fn rust_uv_set_data_for_uv_handle(handle: *libc::c_void,
854856
data: *libc::c_void);
855-
unsafe fn rust_uv_get_data_for_req(req: *libc::c_void) -> *libc::c_void;
857+
unsafe fn rust_uv_get_data_for_req(req: *libc::c_void)
858+
-> *libc::c_void;
856859
unsafe fn rust_uv_set_data_for_req(req: *libc::c_void,
857860
data: *libc::c_void);
858861
unsafe fn rust_uv_get_base_from_buf(++buf: uv_buf_t) -> *u8;

branches/auto/src/test/auxiliary/cci_intrinsic.rs

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,25 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[abi = "rust-intrinsic"]
12-
pub extern mod rusti {
13-
fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int;
14-
fn atomic_cxchg_acq(dst: &mut int, old: int, src: int) -> int;
15-
fn atomic_cxchg_rel(dst: &mut int, old: int, src: int) -> int;
11+
pub mod rusti {
12+
#[abi = "rust-intrinsic"]
13+
pub extern {
14+
fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int;
15+
fn atomic_cxchg_acq(dst: &mut int, old: int, src: int) -> int;
16+
fn atomic_cxchg_rel(dst: &mut int, old: int, src: int) -> int;
1617

17-
fn atomic_xchg(dst: &mut int, src: int) -> int;
18-
fn atomic_xchg_acq(dst: &mut int, src: int) -> int;
19-
fn atomic_xchg_rel(dst: &mut int, src: int) -> int;
20-
21-
fn atomic_xadd(dst: &mut int, src: int) -> int;
22-
fn atomic_xadd_acq(dst: &mut int, src: int) -> int;
23-
fn atomic_xadd_rel(dst: &mut int, src: int) -> int;
24-
25-
fn atomic_xsub(dst: &mut int, src: int) -> int;
26-
fn atomic_xsub_acq(dst: &mut int, src: int) -> int;
27-
fn atomic_xsub_rel(dst: &mut int, src: int) -> int;
18+
fn atomic_xchg(dst: &mut int, src: int) -> int;
19+
fn atomic_xchg_acq(dst: &mut int, src: int) -> int;
20+
fn atomic_xchg_rel(dst: &mut int, src: int) -> int;
21+
22+
fn atomic_xadd(dst: &mut int, src: int) -> int;
23+
fn atomic_xadd_acq(dst: &mut int, src: int) -> int;
24+
fn atomic_xadd_rel(dst: &mut int, src: int) -> int;
25+
26+
fn atomic_xsub(dst: &mut int, src: int) -> int;
27+
fn atomic_xsub_acq(dst: &mut int, src: int) -> int;
28+
fn atomic_xsub_rel(dst: &mut int, src: int) -> int;
29+
}
2830
}
2931

3032
#[inline(always)]

branches/auto/src/test/auxiliary/extern-crosscrate-source.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313

1414
#[crate_type = "lib"];
1515

16-
pub extern mod rustrt {
17-
pub fn rust_dbg_call(cb: *u8,
18-
data: libc::uintptr_t) -> libc::uintptr_t;
16+
pub mod rustrt {
17+
pub extern {
18+
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
19+
-> libc::uintptr_t;
20+
}
1921
}
2022

2123
pub fn fact(n: uint) -> uint {

branches/auto/src/test/auxiliary/foreign_lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
#[link(name="foreign_lib", vers="0.0")];
1212

13-
pub extern mod rustrt {
14-
pub fn rust_get_argc() -> libc::c_int;
13+
pub mod rustrt {
14+
pub extern {
15+
pub fn rust_get_argc() -> libc::c_int;
16+
}
1517
}
18+

branches/auto/src/test/auxiliary/issue_3882.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ mod issue_3882 {
1313
len: libc::size_t,
1414
}
1515

16-
extern mod c {
17-
fn linenoiseAddCompletion(lc: *mut Completions);
16+
mod c {
17+
extern {
18+
fn linenoiseAddCompletion(lc: *mut Completions);
19+
}
1820
}
1921
}

branches/auto/src/test/bench/shootout-nbody.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ use core::os;
2020
// because the the indirection through another dynamic linker
2121
// stub. Kind of shocking. Might be able to make it faster still with
2222
// an llvm intrinsic.
23-
#[nolink]
24-
extern mod libc {
25-
pub fn sqrt(n: float) -> float;
23+
mod libc {
24+
#[nolink]
25+
pub extern {
26+
pub fn sqrt(n: float) -> float;
27+
}
2628
}
2729

2830
fn main() {

branches/auto/src/test/compile-fail/empty-linkname.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
// error-pattern:empty #[link_name] not allowed; use #[nolink].
1212

1313
#[link_name = ""]
14-
extern mod foo {
14+
extern {
1515
}

branches/auto/src/test/compile-fail/empty-linkname2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313

1414
#[link_name = ""]
1515
#[nolink]
16-
extern mod foo {
16+
extern {
1717
}

branches/auto/src/test/compile-fail/foreign-unsafe-fn-called.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
// except according to those terms.
1111

1212

13-
#[abi = "cdecl"]
14-
extern mod test {
15-
pub unsafe fn free();
13+
mod test {
14+
#[abi = "cdecl"]
15+
pub extern {
16+
pub unsafe fn free();
17+
}
1618
}
1719

1820
fn main() {

branches/auto/src/test/compile-fail/foreign-unsafe-fn.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
// except according to those terms.
1111

1212

13-
#[abi = "cdecl"]
14-
extern mod test {
15-
pub unsafe fn free();
13+
mod test {
14+
#[abi = "cdecl"]
15+
pub extern {
16+
pub unsafe fn free();
17+
}
1618
}
1719

1820
fn main() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ the compiler output. */
1616

1717
#[link_args = "aFdEfSeVEEE"]
1818
#[nolink]
19-
extern mod m1 {}
19+
extern {}
2020

2121
fn main() { }

branches/auto/src/test/compile-fail/redundant-link-args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
#[link_name= "m"]
2020
#[link_args="-foo"] // this could have been elided.
21-
extern mod m1 {
21+
extern {
2222
}
2323

2424
#[link_name= "m"]
2525
#[link_args="-bar"] // this is the actual error trigger.
26-
extern mod m2 {
26+
extern {
2727
}

branches/auto/src/test/compile-fail/warn-ctypes-err-attr.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
// error-pattern:found rust type
1212
#[deny(ctypes)];
1313

14-
#[nolink]
15-
extern mod libc {
16-
pub fn malloc(size: int) -> *u8;
14+
mod libc {
15+
#[nolink]
16+
pub extern {
17+
pub fn malloc(size: int) -> *u8;
18+
}
1719
}
1820

1921
fn main() {

branches/auto/src/test/compile-fail/warn-ctypes.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010

1111
// compile-flags:-D ctypes
1212
// error-pattern:found rust type
13-
#[nolink]
14-
extern mod libc {
15-
pub fn malloc(size: int) -> *u8;
13+
mod libc {
14+
#[nolink]
15+
extern {
16+
pub fn malloc(size: int) -> *u8;
17+
}
1618
}
1719

1820
fn main() {

branches/auto/src/test/compile-fail/warn-foreign-int-types.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
// except according to those terms.
1010

1111
//error-pattern:libc::c_int or libc::c_long should be used
12-
extern mod xx {
13-
pub fn strlen(str: *u8) -> uint;
14-
pub fn foo(x: int, y: uint);
12+
mod xx {
13+
pub extern {
14+
pub fn strlen(str: *u8) -> uint;
15+
pub fn foo(x: int, y: uint);
16+
}
1517
}
1618

1719
fn main() {

branches/auto/src/test/run-fail/extern-fail.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
// Testing that runtime failure doesn't cause callbacks to abort abnormally.
1313
// Instead the failure will be delivered after the callbacks return.
1414

15-
extern mod rustrt {
16-
pub fn rust_dbg_call(cb: *u8,
17-
data: libc::uintptr_t) -> libc::uintptr_t;
15+
mod rustrt {
16+
pub extern {
17+
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
18+
-> libc::uintptr_t;
19+
}
1820
}
1921

2022
extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t {

branches/auto/src/test/run-fail/morestack2.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717

1818
extern mod std;
1919

20-
extern mod rustrt {
21-
pub fn rust_get_argc() -> libc::c_int;
20+
mod rustrt {
21+
pub extern {
22+
pub fn rust_get_argc() -> libc::c_int;
23+
}
2224
}
2325

2426
fn getbig_call_c_and_fail(i: int) {

0 commit comments

Comments
 (0)