diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2014-04-21 17:58:52 -0400 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-06-24 17:18:48 -0700 |
| commit | 9e3d0b002a5c2e81d43351c9b8550a3f4ccfb8f9 (patch) | |
| tree | 1e9a15e8a55cc3947025ab3ac044c2f7977159d9 /src/liballoc | |
| parent | f7f95c8f5a6294f161800dbb65a0423bb5248f34 (diff) | |
| download | rust-9e3d0b002a5c2e81d43351c9b8550a3f4ccfb8f9.tar.gz rust-9e3d0b002a5c2e81d43351c9b8550a3f4ccfb8f9.zip | |
librustc: Remove the fallback to `int` from typechecking.
This breaks a fair amount of code. The typical patterns are:
* `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`;
* `println!("{}", 3)`: change to `println!("{}", 3i)`;
* `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`.
RFC #30. Closes #6023.
[breaking-change]
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 94bf3368a0a..cccd5cb63ef 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -39,7 +39,7 @@ use heap::deallocate; /// let numbers = Vec::from_fn(100, |i| i as f32); /// let shared_numbers = Arc::new(numbers); /// -/// for _ in range(0, 10) { +/// for _ in range(0u, 10) { /// let child_numbers = shared_numbers.clone(); /// /// spawn(proc() { diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index db6af30bce7..c6e81fa7f7c 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -276,7 +276,7 @@ mod tests { #[test] fn test_clone() { - let x = Rc::new(RefCell::new(5)); + let x = Rc::new(RefCell::new(5i)); let y = x.clone(); *x.borrow_mut() = 20; assert_eq!(*y.borrow(), 20); @@ -284,13 +284,13 @@ mod tests { #[test] fn test_simple() { - let x = Rc::new(5); + let x = Rc::new(5i); assert_eq!(*x, 5); } #[test] fn test_simple_clone() { - let x = Rc::new(5); + let x = Rc::new(5i); let y = x.clone(); assert_eq!(*x, 5); assert_eq!(*y, 5); @@ -298,20 +298,20 @@ mod tests { #[test] fn test_destructor() { - let x = Rc::new(box 5); + let x = Rc::new(box 5i); assert_eq!(**x, 5); } #[test] fn test_live() { - let x = Rc::new(5); + let x = Rc::new(5i); let y = x.downgrade(); assert!(y.upgrade().is_some()); } #[test] fn test_dead() { - let x = Rc::new(5); + let x = Rc::new(5i); let y = x.downgrade(); drop(x); assert!(y.upgrade().is_none()); @@ -321,7 +321,7 @@ mod tests { fn gc_inside() { // see issue #11532 use std::gc::GC; - let a = Rc::new(RefCell::new(box(GC) 1)); + let a = Rc::new(RefCell::new(box(GC) 1i)); assert!(a.try_borrow_mut().is_some()); } |
