Skip to content

Commit a6dbccc

Browse files
committed
---
yaml --- r: 72170 b: refs/heads/dist-snap c: 047ba26 h: refs/heads/master v: v3
1 parent d04cd53 commit a6dbccc

Some content is hidden

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

113 files changed

+1134
-1095
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: cd982ad3f74673c55af6034a4f757e60be9b381c
10+
refs/heads/dist-snap: 047ba2642f39baa60c13aa0318ddcb09d9ca5301
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ do spawn {
16701670
~~~~
16711671

16721672
If you want to see the output of `debug!` statements, you will need to turn on `debug!` logging.
1673-
To enable `debug!` logging, set the RUST_LOG environment variable to `debug` (e.g., with bash, `export RUST_LOG=debug`)
1673+
To enable `debug!` logging, set the RUST_LOG environment variable to the name of your crate, which, for a file named `foo.rs`, will be `foo` (e.g., with bash, `export RUST_LOG=foo`).
16741674

16751675
## For loops
16761676

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ pub mod streamp {
112112

113113
#[allow(non_camel_case_types)]
114114
pub mod server {
115+
priv use core::kinds::Owned;
116+
115117
#[allow(non_camel_case_types)]
116118
pub type Open<T> = ::core::pipes::RecvPacket<super::Open<T>>;
117119
}
@@ -386,6 +388,8 @@ pub mod oneshot {
386388
387389
#[allow(non_camel_case_types)]
388390
pub mod server {
391+
priv use core::kinds::Owned;
392+
389393
#[allow(non_camel_case_types)]
390394
pub type Oneshot<T> =
391395
::core::pipes::RecvPacketBuffered<super::Oneshot<T>,

branches/dist-snap/src/libcore/rt/sched/local_sched.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,18 @@ pub fn borrow(f: &fn(&mut Scheduler)) {
6666
/// Because this leaves the Scheduler in thread-local storage it is possible
6767
/// For the Scheduler pointer to be aliased
6868
pub unsafe fn unsafe_borrow() -> &mut Scheduler {
69-
let key = tls_key();
70-
let mut void_sched: *mut c_void = tls::get(key);
71-
assert!(void_sched.is_not_null());
72-
{
73-
let void_sched_ptr = &mut void_sched;
74-
let sched: &mut ~Scheduler = {
75-
transmute::<&mut *mut c_void, &mut ~Scheduler>(void_sched_ptr)
76-
};
77-
let sched: &mut Scheduler = &mut **sched;
78-
return sched;
69+
unsafe {
70+
let key = tls_key();
71+
let mut void_sched: *mut c_void = tls::get(key);
72+
assert!(void_sched.is_not_null());
73+
{
74+
let void_sched_ptr = &mut void_sched;
75+
let sched: &mut ~Scheduler = {
76+
transmute::<&mut *mut c_void, &mut ~Scheduler>(void_sched_ptr)
77+
};
78+
let sched: &mut Scheduler = &mut **sched;
79+
return sched;
80+
}
7981
}
8082
}
8183

branches/dist-snap/src/libcore/rt/uv/net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ fn connect_read() {
388388
vec_to_uv_buf(vec::from_elem(size, 0))
389389
};
390390
do stream_watcher.read_start(alloc)
391-
|stream_watcher, _nread, buf, status| {
391+
|stream_watcher, nread, buf, status| {
392392
393393
let buf = vec_from_uv_buf(buf);
394394
rtdebug!("read cb!");

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ fn test_simple_deep() {
6464
if i == 0 { return }
6565

6666
for walk_stack |_frame| {
67-
breakpoint();
67+
unsafe {
68+
breakpoint();
69+
}
6870
}
6971
run(i - 1);
7072
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3346,15 +3346,15 @@ mod tests {
33463346
#[test]
33473347
fn test_shift_byte() {
33483348
let mut s = ~"ABC";
3349-
let b = raw::shift_byte(&mut s);
3349+
let b = unsafe { raw::shift_byte(&mut s) };
33503350
assert!((s == ~"BC"));
33513351
assert!((b == 65u8));
33523352
}
33533353
33543354
#[test]
33553355
fn test_pop_byte() {
33563356
let mut s = ~"ABC";
3357-
let b = raw::pop_byte(&mut s);
3357+
let b = unsafe { raw::pop_byte(&mut s) };
33583358
assert!((s == ~"AB"));
33593359
assert!((b == 67u8));
33603360
}

branches/dist-snap/src/libcore/task/local_data.rs

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -150,28 +150,32 @@ fn test_tls_modify() {
150150
151151
#[test]
152152
fn test_tls_crust_automorestack_memorial_bug() {
153-
// This might result in a stack-canary clobber if the runtime fails to
154-
// set sp_limit to 0 when calling the cleanup extern - it might
155-
// automatically jump over to the rust stack, which causes next_c_sp
156-
// to get recorded as something within a rust stack segment. Then a
157-
// subsequent upcall (esp. for logging, think vsnprintf) would run on
158-
// a stack smaller than 1 MB.
159-
fn my_key(_x: @~str) { }
160-
do task::spawn {
161-
unsafe { local_data_set(my_key, @~"hax"); }
153+
unsafe {
154+
// This might result in a stack-canary clobber if the runtime fails to
155+
// set sp_limit to 0 when calling the cleanup extern - it might
156+
// automatically jump over to the rust stack, which causes next_c_sp
157+
// to get recorded as something within a rust stack segment. Then a
158+
// subsequent upcall (esp. for logging, think vsnprintf) would run on
159+
// a stack smaller than 1 MB.
160+
fn my_key(_x: @~str) { }
161+
do task::spawn {
162+
unsafe { local_data_set(my_key, @~"hax"); }
163+
}
162164
}
163165
}
164166
165167
#[test]
166168
fn test_tls_multiple_types() {
167-
fn str_key(_x: @~str) { }
168-
fn box_key(_x: @@()) { }
169-
fn int_key(_x: @int) { }
170-
do task::spawn {
171-
unsafe {
172-
local_data_set(str_key, @~"string data");
173-
local_data_set(box_key, @@());
174-
local_data_set(int_key, @42);
169+
unsafe {
170+
fn str_key(_x: @~str) { }
171+
fn box_key(_x: @@()) { }
172+
fn int_key(_x: @int) { }
173+
do task::spawn {
174+
unsafe {
175+
local_data_set(str_key, @~"string data");
176+
local_data_set(box_key, @@());
177+
local_data_set(int_key, @42);
178+
}
175179
}
176180
}
177181
}

branches/dist-snap/src/libfuzzer/fuzzer.rc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub fn stash_ty_if(c: @fn(@ast::Ty, test_mode)->bool,
160160

161161
pub struct StolenStuff {exprs: ~[ast::expr], tys: ~[ast::Ty]}
162162

163-
pub fn steal(crate: @ast::crate, tm: test_mode) -> StolenStuff {
163+
pub fn steal(crate: ast::crate, tm: test_mode) -> StolenStuff {
164164
let exprs = @mut ~[];
165165
let tys = @mut ~[];
166166
let v = visit::mk_simple_visitor(@visit::SimpleVisitor {
@@ -197,7 +197,7 @@ pub fn safe_to_replace_ty(t: &ast::ty_, _tm: test_mode) -> bool {
197197
}
198198

199199
// Replace the |i|th expr (in fold order) of |crate| with |newexpr|.
200-
pub fn replace_expr_in_crate(crate: @ast::crate, i: uint,
200+
pub fn replace_expr_in_crate(crate: ast::crate, i: uint,
201201
newexpr: ast::expr, tm: test_mode) ->
202202
ast::crate {
203203
let j: @mut uint = @mut 0u;
@@ -222,13 +222,13 @@ pub fn replace_expr_in_crate(crate: @ast::crate, i: uint,
222222
.. *fold::default_ast_fold()
223223
};
224224
let af = fold::make_fold(afp);
225-
let crate2: @ast::crate = @af.fold_crate(crate);
225+
let crate2: @ast::crate = @af.fold_crate(&crate);
226226
*crate2
227227
}
228228

229229

230230
// Replace the |i|th ty (in fold order) of |crate| with |newty|.
231-
pub fn replace_ty_in_crate(crate: @ast::crate, i: uint, newty: ast::Ty,
231+
pub fn replace_ty_in_crate(crate: ast::crate, i: uint, newty: ast::Ty,
232232
tm: test_mode) -> ast::crate {
233233
let j: @mut uint = @mut 0u;
234234
fn fold_ty_rep(j_: @mut uint,
@@ -248,7 +248,7 @@ pub fn replace_ty_in_crate(crate: @ast::crate, i: uint, newty: ast::Ty,
248248
.. *fold::default_ast_fold()
249249
};
250250
let af = fold::make_fold(afp);
251-
let crate2: @ast::crate = @af.fold_crate(crate);
251+
let crate2: @ast::crate = @af.fold_crate(&crate);
252252
*crate2
253253
}
254254

@@ -261,7 +261,7 @@ pub fn as_str(f: @fn(+x: @io::Writer)) -> ~str {
261261
io::with_str_writer(f)
262262
}
263263

264-
pub fn check_variants_of_ast(crate: @ast::crate, codemap: @codemap::CodeMap,
264+
pub fn check_variants_of_ast(crate: ast::crate, codemap: @codemap::CodeMap,
265265
filename: &Path, cx: Context) {
266266
let stolen = steal(crate, cx.mode);
267267
let extra_exprs = do common_exprs().filtered |a| {
@@ -275,13 +275,13 @@ pub fn check_variants_of_ast(crate: @ast::crate, codemap: @codemap::CodeMap,
275275
}
276276

277277
pub fn check_variants_T<T: Copy>(
278-
crate: @ast::crate,
278+
crate: ast::crate,
279279
codemap: @codemap::CodeMap,
280280
filename: &Path,
281281
thing_label: ~str,
282282
things: ~[T],
283283
stringifier: @fn(@T, @syntax::parse::token::ident_interner) -> ~str,
284-
replacer: @fn(@ast::crate, uint, T, test_mode) -> ast::crate,
284+
replacer: @fn(ast::crate, uint, T, test_mode) -> ast::crate,
285285
cx: Context
286286
) {
287287
error!("%s contains %u %s objects", filename.to_str(),
@@ -323,7 +323,7 @@ pub fn check_variants_T<T: Copy>(
323323
last_part(filename.to_str()),
324324
thing_label, i, j);
325325
let safe_to_run = !(content_is_dangerous_to_run(*str3)
326-
|| has_raw_pointers(crate2));
326+
|| has_raw_pointers(*crate2));
327327
check_whole_compiler(*str3, &Path(file_label),
328328
safe_to_run);
329329
}
@@ -480,7 +480,7 @@ pub fn parse_and_print(code: @~str) -> ~str {
480480
}
481481
}
482482

483-
pub fn has_raw_pointers(c: @ast::crate) -> bool {
483+
pub fn has_raw_pointers(c: ast::crate) -> bool {
484484
let has_rp = @mut false;
485485
fn visit_ty(flag: @mut bool, t: @ast::Ty) {
486486
match t.node {
@@ -634,7 +634,7 @@ pub fn check_variants(files: &[Path], cx: Context) {
634634
pprust::no_ann(),
635635
false)))
636636
});
637-
check_variants_of_ast(crate, sess.cm, file, cx);
637+
check_variants_of_ast(*crate, sess.cm, file, cx);
638638
}
639639
}
640640

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub enum output_type {
4848
output_type_exe,
4949
}
5050

51-
pub fn llvm_err(sess: Session, msg: ~str) -> ! {
51+
pub fn llvm_err(sess: Session, +msg: ~str) -> ! {
5252
unsafe {
5353
let cstr = llvm::LLVMRustGetLastError();
5454
if cstr == ptr::null() {
@@ -153,7 +153,7 @@ pub mod jit {
153153
code: entry,
154154
env: ptr::null()
155155
};
156-
let func: &fn(argv: ~[@~str]) = cast::transmute(closure);
156+
let func: &fn(++argv: ~[@~str]) = cast::transmute(closure);
157157

158158
func(~[sess.opts.binary]);
159159
}
@@ -519,7 +519,7 @@ pub fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
519519
520520
// This calculates CMH as defined above
521521
fn crate_meta_extras_hash(symbol_hasher: &hash::State,
522-
cmh_items: ~[@ast::meta_item],
522+
+cmh_items: ~[@ast::meta_item],
523523
dep_hashes: ~[~str]) -> @str {
524524
fn len_and_str(s: &str) -> ~str {
525525
fmt!("%u_%s", s.len(), s)
@@ -568,7 +568,7 @@ pub fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
568568
name, default));
569569
}
570570
571-
fn crate_meta_name(sess: Session, output: &Path, opt_name: Option<@str>)
571+
fn crate_meta_name(sess: Session, output: &Path, +opt_name: Option<@str>)
572572
-> @str {
573573
return match opt_name {
574574
Some(v) => v,
@@ -703,7 +703,7 @@ pub fn mangle(sess: Session, ss: path) -> ~str {
703703
}
704704
705705
pub fn exported_name(sess: Session,
706-
path: path,
706+
+path: path,
707707
hash: &str,
708708
vers: &str) -> ~str {
709709
return mangle(sess,
@@ -713,7 +713,7 @@ pub fn exported_name(sess: Session,
713713
}
714714
715715
pub fn mangle_exported_name(ccx: @CrateContext,
716-
path: path,
716+
+path: path,
717717
t: ty::t) -> ~str {
718718
let hash = get_symbol_hash(ccx, t);
719719
return exported_name(ccx.sess, path,
@@ -733,17 +733,17 @@ pub fn mangle_internal_name_by_type_only(ccx: @CrateContext,
733733
}
734734
735735
pub fn mangle_internal_name_by_path_and_seq(ccx: @CrateContext,
736-
path: path,
737-
flav: ~str) -> ~str {
736+
+path: path,
737+
+flav: ~str) -> ~str {
738738
return mangle(ccx.sess,
739739
vec::append_one(path, path_name((ccx.names)(flav))));
740740
}
741741
742-
pub fn mangle_internal_name_by_path(ccx: @CrateContext, path: path) -> ~str {
742+
pub fn mangle_internal_name_by_path(ccx: @CrateContext, +path: path) -> ~str {
743743
return mangle(ccx.sess, path);
744744
}
745745
746-
pub fn mangle_internal_name_by_seq(ccx: @CrateContext, flav: ~str) -> ~str {
746+
pub fn mangle_internal_name_by_seq(ccx: @CrateContext, +flav: ~str) -> ~str {
747747
return fmt!("%s_%u", flav, (ccx.names)(flav).repr);
748748
}
749749
@@ -768,7 +768,7 @@ pub fn link_binary(sess: Session,
768768
out_filename: &Path,
769769
lm: LinkMeta) {
770770
// Converts a library file-stem into a cc -l argument
771-
fn unlib(config: @session::config, stem: ~str) -> ~str {
771+
fn unlib(config: @session::config, +stem: ~str) -> ~str {
772772
if stem.starts_with("lib") &&
773773
config.os != session::os_win32 {
774774
stem.slice(3, stem.len()).to_owned()

0 commit comments

Comments
 (0)