Skip to content

Commit 22c204a

Browse files
committed
Revert incorrect usize -> u32 replacements from rust-lang#22510
1 parent 1cc8b6e commit 22c204a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libstd/thread.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ impl Builder {
283283
// address at which our stack started).
284284
let main = move || {
285285
let something_around_the_top_of_the_stack = 1;
286-
let addr = &something_around_the_top_of_the_stack as *const isize;
286+
let addr = &something_around_the_top_of_the_stack as *const i32;
287287
let my_stack_top = addr as usize;
288288
let my_stack_bottom = my_stack_top - stack_size + 1024;
289289
unsafe {
@@ -808,13 +808,13 @@ mod test {
808808
}
809809

810810
fn avoid_copying_the_body<F>(spawnfn: F) where F: FnOnce(Thunk<'static>) {
811-
let (tx, rx) = channel::<u32>();
811+
let (tx, rx) = channel();
812812

813813
let x = box 1;
814-
let x_in_parent = (&*x) as *const isize as u32;
814+
let x_in_parent = (&*x) as *const i32 as usize;
815815

816816
spawnfn(Thunk::new(move|| {
817-
let x_in_child = (&*x) as *const isize as u32;
817+
let x_in_child = (&*x) as *const i32 as usize;
818818
tx.send(x_in_child).unwrap();
819819
}));
820820

@@ -853,8 +853,8 @@ mod test {
853853
// climbing the task tree to dereference each ancestor. (See #1789)
854854
// (well, it would if the constant were 8000+ - I lowered it to be more
855855
// valgrind-friendly. try this at home, instead..!)
856-
static GENERATIONS: usize = 16;
857-
fn child_no(x: usize) -> Thunk<'static> {
856+
const GENERATIONS: u32 = 16;
857+
fn child_no(x: u32) -> Thunk<'static> {
858858
return Thunk::new(move|| {
859859
if x < GENERATIONS {
860860
thread::spawn(move|| child_no(x+1).invoke(()));

0 commit comments

Comments
 (0)