Skip to content

Commit 3349f71

Browse files
committed
---
yaml --- r: 73291 b: refs/heads/dist-snap c: 7bd4217 h: refs/heads/master i: 73289: b193bec 73287: 024fbd7 v: v3
1 parent d3d63e7 commit 3349f71

Some content is hidden

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

107 files changed

+1056
-1150
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10-
refs/heads/dist-snap: 82fa0018c80c8f64cb1b446a7e59492d9ad97b1d
10+
refs/heads/dist-snap: 7bd421776681285bf4dfba09fe7a6dae4c8eecd5
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libcore/cast.rs

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,17 @@
1212
1313
use sys;
1414
use unstable;
15-
16-
pub mod rusti {
17-
#[abi = "rust-intrinsic"]
18-
#[link_name = "rusti"]
19-
pub extern "rust-intrinsic" {
20-
fn forget<T>(x: T);
21-
22-
fn transmute<T,U>(e: T) -> U;
23-
}
24-
}
15+
use unstable::intrinsics;
2516

2617
/// Casts the value at `src` to U. The two types must have the same length.
2718
pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
28-
let mut dest: U = unstable::intrinsics::init();
19+
let mut dest: U = intrinsics::init();
2920
{
30-
let dest_ptr: *mut u8 = rusti::transmute(&mut dest);
31-
let src_ptr: *u8 = rusti::transmute(src);
32-
unstable::intrinsics::memmove64(dest_ptr,
33-
src_ptr,
34-
sys::size_of::<U>() as u64);
21+
let dest_ptr: *mut u8 = transmute(&mut dest);
22+
let src_ptr: *u8 = transmute(src);
23+
intrinsics::memmove64(dest_ptr,
24+
src_ptr,
25+
sys::size_of::<U>() as u64);
3526
}
3627
dest
3728
}
@@ -45,7 +36,7 @@ pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
4536
* reinterpret_cast on pointer types.
4637
*/
4738
#[inline(always)]
48-
pub unsafe fn forget<T>(thing: T) { rusti::forget(thing); }
39+
pub unsafe fn forget<T>(thing: T) { intrinsics::forget(thing); }
4940

5041
/**
5142
* Force-increment the reference count on a shared box. If used
@@ -65,7 +56,7 @@ pub unsafe fn bump_box_refcount<T>(t: @T) { forget(t); }
6556
*/
6657
#[inline(always)]
6758
pub unsafe fn transmute<L, G>(thing: L) -> G {
68-
rusti::transmute(thing)
59+
intrinsics::transmute(thing)
6960
}
7061

7162
/// Coerce an immutable reference to be mutable.

branches/dist-snap/src/libcore/os.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ pub fn self_exe_path() -> Option<Path> {
509509
* Otherwise, homedir returns option::none.
510510
*/
511511
pub fn homedir() -> Option<Path> {
512-
return match getenv("HOME") {
512+
return match getenv(~"HOME") {
513513
Some(ref p) => if !str::is_empty(*p) {
514514
Some(Path(*p))
515515
} else {

branches/dist-snap/src/libcore/stackwalk.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#[doc(hidden)]; // FIXME #3538
1212

1313
use cast::transmute;
14+
use unstable::intrinsics;
1415

1516
pub type Word = uint;
1617

@@ -75,13 +76,6 @@ fn test_simple_deep() {
7576

7677
fn frame_address(f: &fn(x: *u8)) {
7778
unsafe {
78-
rusti::frame_address(f)
79-
}
80-
}
81-
82-
pub mod rusti {
83-
#[abi = "rust-intrinsic"]
84-
pub extern "rust-intrinsic" {
85-
pub fn frame_address(f: &once fn(x: *u8));
79+
intrinsics::frame_address(f)
8680
}
8781
}

branches/dist-snap/src/libcore/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1808,7 +1808,7 @@ pub fn to_utf16(s: &str) -> ~[u16] {
18081808
ch -= 0x1_0000_u32;
18091809
let w1 = 0xD800_u16 | ((ch >> 10) as u16);
18101810
let w2 = 0xDC00_u16 | ((ch as u16) & 0x3FF_u16);
1811-
u.push_all([w1, w2])
1811+
u.push_all(~[w1, w2])
18121812
}
18131813
}
18141814
u

branches/dist-snap/src/libcore/sys.rs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use libc;
1919
use libc::{c_void, c_char, size_t};
2020
use repr;
2121
use str;
22+
use unstable::intrinsics;
2223

2324
pub type FreeGlue<'self> = &'self fn(*TypeDesc, *c_void);
2425

@@ -38,16 +39,6 @@ pub struct Closure {
3839
env: *(),
3940
}
4041

41-
pub mod rusti {
42-
#[abi = "rust-intrinsic"]
43-
pub extern "rust-intrinsic" {
44-
fn get_tydesc<T>() -> *();
45-
fn size_of<T>() -> uint;
46-
fn pref_align_of<T>() -> uint;
47-
fn min_align_of<T>() -> uint;
48-
}
49-
}
50-
5142
pub mod rustrt {
5243
use libc::{c_char, size_t};
5344

@@ -81,7 +72,7 @@ pub fn shape_le<T:Ord>(x1: &T, x2: &T) -> bool {
8172
*/
8273
#[inline(always)]
8374
pub fn get_type_desc<T>() -> *TypeDesc {
84-
unsafe { rusti::get_tydesc::<T>() as *TypeDesc }
75+
unsafe { intrinsics::get_tydesc::<T>() as *TypeDesc }
8576
}
8677

8778
/// Returns a pointer to a type descriptor.
@@ -93,7 +84,7 @@ pub fn get_type_desc_val<T>(_val: &T) -> *TypeDesc {
9384
/// Returns the size of a type
9485
#[inline(always)]
9586
pub fn size_of<T>() -> uint {
96-
unsafe { rusti::size_of::<T>() }
87+
unsafe { intrinsics::size_of::<T>() }
9788
}
9889

9990
/// Returns the size of the type that `_val` points to
@@ -128,7 +119,7 @@ pub fn nonzero_size_of_val<T>(_val: &T) -> uint {
128119
*/
129120
#[inline(always)]
130121
pub fn min_align_of<T>() -> uint {
131-
unsafe { rusti::min_align_of::<T>() }
122+
unsafe { intrinsics::min_align_of::<T>() }
132123
}
133124

134125
/// Returns the ABI-required minimum alignment of the type of the value that
@@ -141,7 +132,7 @@ pub fn min_align_of_val<T>(_val: &T) -> uint {
141132
/// Returns the preferred alignment of a type
142133
#[inline(always)]
143134
pub fn pref_align_of<T>() -> uint {
144-
unsafe { rusti::pref_align_of::<T>() }
135+
unsafe { intrinsics::pref_align_of::<T>() }
145136
}
146137

147138
/// Returns the preferred alignment of the type of the value that

branches/dist-snap/src/libcore/unstable/extfmt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ pub mod ct {
178178
i += 1;
179179

180180
if i >= lim {
181-
err("unterminated conversion at end of string");
181+
err(~"unterminated conversion at end of string");
182182
} else if s[i] == '%' as u8 {
183183
push_slice(&mut pieces, s, h, i);
184184
i += 1;
@@ -309,7 +309,7 @@ pub mod ct {
309309

310310
pub fn parse_type(s: &str, i: uint, lim: uint, err: ErrorFn) ->
311311
Parsed<Ty> {
312-
if i >= lim { err("missing type in conversion"); }
312+
if i >= lim { err(~"missing type in conversion"); }
313313

314314
// FIXME (#2249): Do we really want two signed types here?
315315
// How important is it to be printf compatible?

branches/dist-snap/src/libcore/unstable/intrinsics.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,16 @@ pub extern "rust-intrinsic" {
114114
/// `forget` is unsafe because the caller is responsible for
115115
/// ensuring the argument is deallocated already.
116116
pub unsafe fn forget<T>(_: T) -> ();
117+
pub fn transmute<T,U>(e: T) -> U;
117118

118119
/// Returns `true` if a type requires drop glue.
119120
pub fn needs_drop<T>() -> bool;
120121

121122
// XXX: intrinsic uses legacy modes and has reference to TyDesc
122123
// and TyVisitor which are in librustc
123124
//fn visit_tydesc(++td: *TyDesc, &&tv: TyVisitor) -> ();
124-
// XXX: intrinsic uses legacy modes
125-
//fn frame_address(f: &once fn(*u8));
125+
126+
pub fn frame_address(f: &once fn(*u8));
126127

127128
/// Get the address of the `__morestack` stack growth function.
128129
pub fn morestack_addr() -> *();

branches/dist-snap/src/librustc/back/link.rs

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,8 @@ pub mod write {
387387
fmt!("%s/bin/arm-linux-androideabi-gcc", path)
388388
}
389389
&None => {
390-
sess.fatal("need Android NDK path for building \
391-
(--android-cross-path)")
390+
sess.fatal(~"need Android NDK path for building \
391+
(--android-cross-path)")
392392
}
393393
};
394394
let mut cc_args = ~[];
@@ -403,7 +403,7 @@ pub mod write {
403403
sess.err(fmt!("building with `%s` failed with code %d",
404404
cc_prog, prog.status));
405405
sess.note(fmt!("%s arguments: %s",
406-
cc_prog, str::connect(cc_args, " ")));
406+
cc_prog, str::connect(cc_args, ~" ")));
407407
sess.note(prog.err + prog.out);
408408
sess.abort_if_errors();
409409
}
@@ -566,7 +566,7 @@ pub fn build_link_meta(sess: Session,
566566
|| fmt!("output file name `%s` doesn't\
567567
appear to have a stem",
568568
output.to_str())).to_managed();
569-
warn_missing(sess, "name", name);
569+
warn_missing(sess, ~"name", name);
570570
name
571571
}
572572
};
@@ -577,7 +577,7 @@ pub fn build_link_meta(sess: Session,
577577
Some(v) => v,
578578
None => {
579579
let vers = @"0.0";
580-
warn_missing(sess, "vers", vers);
580+
warn_missing(sess, ~"vers", vers);
581581
vers
582582
}
583583
};
@@ -618,9 +618,9 @@ pub fn symbol_hash(tcx: ty::ctxt,
618618
619619
symbol_hasher.reset();
620620
write_string(symbol_hasher, link_meta.name);
621-
write_string(symbol_hasher, "-");
621+
write_string(symbol_hasher, ~"-");
622622
write_string(symbol_hasher, link_meta.extras_hash);
623-
write_string(symbol_hasher, "-");
623+
write_string(symbol_hasher, ~"-");
624624
write_string(symbol_hasher, encoder::encoded_ty(tcx, t));
625625
let mut hash = truncated_hash_result(symbol_hasher);
626626
// Prefix with _ so that it never blends into adjacent digits
@@ -770,8 +770,8 @@ pub fn link_binary(sess: Session,
770770
fmt!("%s/bin/arm-linux-androideabi-gcc", path)
771771
}
772772
&None => {
773-
sess.fatal("need Android NDK path for linking \
774-
(--android-cross-path)")
773+
sess.fatal(~"need Android NDK path for linking \
774+
(--android-cross-path)")
775775
}
776776
}
777777
} else if sess.targ_cfg.os == session::os_win32 {
@@ -798,21 +798,21 @@ pub fn link_binary(sess: Session,
798798
799799
debug!("output: %s", output.to_str());
800800
let cc_args = link_args(sess, obj_filename, out_filename, lm);
801-
debug!("%s link args: %s", cc_prog, str::connect(cc_args, " "));
801+
debug!("%s link args: %s", cc_prog, str::connect(cc_args, ~" "));
802802
// We run 'cc' here
803803
let prog = run::program_output(cc_prog, cc_args);
804804
if 0 != prog.status {
805805
sess.err(fmt!("linking with `%s` failed with code %d",
806806
cc_prog, prog.status));
807807
sess.note(fmt!("%s arguments: %s",
808-
cc_prog, str::connect(cc_args, " ")));
808+
cc_prog, str::connect(cc_args, ~" ")));
809809
sess.note(prog.err + prog.out);
810810
sess.abort_if_errors();
811811
}
812812
813813
// Clean up on Darwin
814814
if sess.targ_cfg.os == session::os_macos {
815-
run::run_program("dsymutil", [output.to_str()]);
815+
run::run_program(~"dsymutil", ~[output.to_str()]);
816816
}
817817
818818
// Remove the temporary object file if we aren't saving temps
@@ -920,26 +920,27 @@ pub fn link_args(sess: Session,
920920
// On linux librt and libdl are an indirect dependencies via rustrt,
921921
// and binutils 2.22+ won't add them automatically
922922
if sess.targ_cfg.os == session::os_linux {
923-
args.push_all([~"-lrt", ~"-ldl"]);
923+
args.push_all(~[~"-lrt", ~"-ldl"]);
924924

925925
// LLVM implements the `frem` instruction as a call to `fmod`,
926926
// which lives in libm. Similar to above, on some linuxes we
927927
// have to be explicit about linking to it. See #2510
928928
args.push(~"-lm");
929929
}
930930
else if sess.targ_cfg.os == session::os_android {
931-
args.push_all([~"-ldl", ~"-llog", ~"-lsupc++", ~"-lgnustl_shared"]);
931+
args.push_all(~[~"-ldl", ~"-llog", ~"-lsupc++",
932+
~"-lgnustl_shared"]);
932933
args.push(~"-lm");
933934
}
934935

935936
if sess.targ_cfg.os == session::os_freebsd {
936-
args.push_all([~"-pthread", ~"-lrt",
937-
~"-L/usr/local/lib", ~"-lexecinfo",
938-
~"-L/usr/local/lib/gcc46",
939-
~"-L/usr/local/lib/gcc44", ~"-lstdc++",
940-
~"-Wl,-z,origin",
941-
~"-Wl,-rpath,/usr/local/lib/gcc46",
942-
~"-Wl,-rpath,/usr/local/lib/gcc44"]);
937+
args.push_all(~[~"-pthread", ~"-lrt",
938+
~"-L/usr/local/lib", ~"-lexecinfo",
939+
~"-L/usr/local/lib/gcc46",
940+
~"-L/usr/local/lib/gcc44", ~"-lstdc++",
941+
~"-Wl,-z,origin",
942+
~"-Wl,-rpath,/usr/local/lib/gcc46",
943+
~"-Wl,-rpath,/usr/local/lib/gcc44"]);
943944
}
944945

945946
// OS X 10.6 introduced 'compact unwind info', which is produced by the

branches/dist-snap/src/librustc/back/rpath.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ fn get_rpaths(os: session::os,
8686
}
8787
}
8888

89-
log_rpaths("relative", rel_rpaths);
90-
log_rpaths("absolute", abs_rpaths);
91-
log_rpaths("fallback", fallback_rpaths);
89+
log_rpaths(~"relative", rel_rpaths);
90+
log_rpaths(~"absolute", abs_rpaths);
91+
log_rpaths(~"fallback", fallback_rpaths);
9292

9393
let mut rpaths = rel_rpaths;
9494
rpaths.push_all(abs_rpaths);

0 commit comments

Comments
 (0)