diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-06-27 12:30:25 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-06-29 11:47:58 -0700 |
| commit | a5bb0a3a4574af88add700ace7aefc37172fa7a5 (patch) | |
| tree | 5c2505254a2fdc396d600807b071c00b064c18b7 /src/librustrt | |
| parent | bd9563aa382ccfbda36049786329edcdc609930c (diff) | |
| download | rust-a5bb0a3a4574af88add700ace7aefc37172fa7a5.tar.gz rust-a5bb0a3a4574af88add700ace7aefc37172fa7a5.zip | |
librustc: Remove the fallback to `int` for integers and `f64` for
floating point numbers for real.
This will break code that looks like:
let mut x = 0;
while ... {
x += 1;
}
println!("{}", x);
Change that code to:
let mut x = 0i;
while ... {
x += 1;
}
println!("{}", x);
Closes #15201.
[breaking-change]
Diffstat (limited to 'src/librustrt')
| -rw-r--r-- | src/librustrt/local_heap.rs | 4 | ||||
| -rw-r--r-- | src/librustrt/local_ptr.rs | 4 | ||||
| -rw-r--r-- | src/librustrt/task.rs | 6 | ||||
| -rw-r--r-- | src/librustrt/thread_local_storage.rs | 8 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/librustrt/local_heap.rs b/src/librustrt/local_heap.rs index aca9e46d2f4..273505c416a 100644 --- a/src/librustrt/local_heap.rs +++ b/src/librustrt/local_heap.rs @@ -335,11 +335,11 @@ mod bench { #[bench] fn alloc_managed_small(b: &mut Bencher) { - b.iter(|| { box(GC) 10 }); + b.iter(|| { box(GC) 10i }); } #[bench] fn alloc_managed_big(b: &mut Bencher) { - b.iter(|| { box(GC) ([10, ..1000]) }); + b.iter(|| { box(GC) ([10i, ..1000]) }); } } diff --git a/src/librustrt/local_ptr.rs b/src/librustrt/local_ptr.rs index a0140129c0b..813ea0f30f3 100644 --- a/src/librustrt/local_ptr.rs +++ b/src/librustrt/local_ptr.rs @@ -172,7 +172,7 @@ pub mod compiled { rtassert!(!ptr.is_null()); let ptr: Box<T> = mem::transmute(ptr); // can't use `as`, due to type not matching with `cfg(test)` - RT_TLS_PTR = mem::transmute(0); + RT_TLS_PTR = mem::transmute(0u); ptr } @@ -189,7 +189,7 @@ pub mod compiled { } else { let ptr: Box<T> = mem::transmute(ptr); // can't use `as`, due to type not matching with `cfg(test)` - RT_TLS_PTR = mem::transmute(0); + RT_TLS_PTR = mem::transmute(0u); Some(ptr) } } diff --git a/src/librustrt/task.rs b/src/librustrt/task.rs index 6e27310f09a..891d0d5a8e3 100644 --- a/src/librustrt/task.rs +++ b/src/librustrt/task.rs @@ -560,7 +560,7 @@ mod test { #[test] fn local_heap() { - let a = box(GC) 5; + let a = box(GC) 5i; let b = a; assert!(*a == 5); assert!(*b == 5); @@ -596,14 +596,14 @@ mod test { #[test] fn comm_stream() { let (tx, rx) = channel(); - tx.send(10); + tx.send(10i); assert!(rx.recv() == 10); } #[test] fn comm_shared_chan() { let (tx, rx) = channel(); - tx.send(10); + tx.send(10i); assert!(rx.recv() == 10); } diff --git a/src/librustrt/thread_local_storage.rs b/src/librustrt/thread_local_storage.rs index e1db67140aa..3b9ee31d8e5 100644 --- a/src/librustrt/thread_local_storage.rs +++ b/src/librustrt/thread_local_storage.rs @@ -100,15 +100,15 @@ mod test { use std::mem::transmute; unsafe { let mut key = 0; - let value = box 20; + let value = box 20i; create(&mut key); set(key, transmute(value)); let value: Box<int> = transmute(get(key)); - assert_eq!(value, box 20); - let value = box 30; + assert_eq!(value, box 20i); + let value = box 30i; set(key, transmute(value)); let value: Box<int> = transmute(get(key)); - assert_eq!(value, box 30); + assert_eq!(value, box 30i); } } } |
