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/libsyntax/util | |
| 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/libsyntax/util')
| -rw-r--r-- | src/libsyntax/util/small_vector.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libsyntax/util/small_vector.rs b/src/libsyntax/util/small_vector.rs index a3b2c23dfdf..d5cc2c7f304 100644 --- a/src/libsyntax/util/small_vector.rs +++ b/src/libsyntax/util/small_vector.rs @@ -173,7 +173,7 @@ mod test { #[test] fn test_push_get() { let mut v = SmallVector::zero(); - v.push(1); + v.push(1i); assert_eq!(1, v.len()); assert_eq!(&1, v.get(0)); v.push(2); @@ -186,7 +186,7 @@ mod test { #[test] fn test_from_iter() { - let v: SmallVector<int> = (vec!(1, 2, 3)).move_iter().collect(); + let v: SmallVector<int> = (vec!(1i, 2, 3)).move_iter().collect(); assert_eq!(3, v.len()); assert_eq!(&1, v.get(0)); assert_eq!(&2, v.get(1)); @@ -199,11 +199,11 @@ mod test { let v: Vec<int> = v.move_iter().collect(); assert_eq!(Vec::new(), v); - let v = SmallVector::one(1); - assert_eq!(vec!(1), v.move_iter().collect()); + let v = SmallVector::one(1i); + assert_eq!(vec!(1i), v.move_iter().collect()); - let v = SmallVector::many(vec!(1, 2, 3)); - assert_eq!(vec!(1, 2, 3), v.move_iter().collect()); + let v = SmallVector::many(vec!(1i, 2i, 3i)); + assert_eq!(vec!(1i, 2i, 3i), v.move_iter().collect()); } #[test] @@ -220,7 +220,7 @@ mod test { #[test] fn test_expect_one_one() { - assert_eq!(1, SmallVector::one(1).expect_one("")); - assert_eq!(1, SmallVector::many(vec!(1)).expect_one("")); + assert_eq!(1i, SmallVector::one(1i).expect_one("")); + assert_eq!(1i, SmallVector::many(vec!(1i)).expect_one("")); } } |
