Skip to content

Commit ce5daab

Browse files
committed
---
yaml --- r: 139968 b: refs/heads/try2 c: 98dfeb1 h: refs/heads/master v: v3
1 parent ba8009b commit ce5daab

File tree

7 files changed

+32
-44
lines changed

7 files changed

+32
-44
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: c97bee26967bfb5a7dccbb1ae1572a6c4da38f15
8+
refs/heads/try2: 98dfeb173fc1fbe8724abf8cf0943bd32653dd65
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcore/comm.rs

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

113113
#[allow(non_camel_case_types)]
114114
pub mod server {
115-
priv use core::kinds::Owned;
116-
117115
#[allow(non_camel_case_types)]
118116
pub type Open<T> = ::core::pipes::RecvPacket<super::Open<T>>;
119117
}
@@ -388,8 +386,6 @@ pub mod oneshot {
388386
389387
#[allow(non_camel_case_types)]
390388
pub mod server {
391-
priv use core::kinds::Owned;
392-
393389
#[allow(non_camel_case_types)]
394390
pub type Oneshot<T> =
395391
::core::pipes::RecvPacketBuffered<super::Oneshot<T>,

branches/try2/src/libcore/rt/sched/local_sched.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,16 @@ 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-
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-
}
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;
8179
}
8280
}
8381

branches/try2/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/try2/src/libcore/stackwalk.rs

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

6666
for walk_stack |_frame| {
67-
unsafe {
68-
breakpoint();
69-
}
67+
breakpoint();
7068
}
7169
run(i - 1);
7270
}

branches/try2/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 = unsafe { raw::shift_byte(&mut s) };
3349+
let b = 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 = unsafe { raw::pop_byte(&mut s) };
3357+
let b = raw::pop_byte(&mut s);
33583358
assert!((s == ~"AB"));
33593359
assert!((b == 67u8));
33603360
}

branches/try2/src/libcore/task/local_data.rs

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -150,32 +150,28 @@ fn test_tls_modify() {
150150
151151
#[test]
152152
fn test_tls_crust_automorestack_memorial_bug() {
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-
}
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"); }
164162
}
165163
}
166164
167165
#[test]
168166
fn test_tls_multiple_types() {
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-
}
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);
179175
}
180176
}
181177
}

0 commit comments

Comments
 (0)