diff --git a/src/doc/guide-unsafe.md b/src/doc/guide-unsafe.md index ffaabbb04ab68..3852591da5ba2 100644 --- a/src/doc/guide-unsafe.md +++ b/src/doc/guide-unsafe.md @@ -267,12 +267,12 @@ impl Drop for Unique { // A comparison between the built-in `Box` and this reimplementation fn main() { { - let mut x = box 5; + let mut x = box 5i; *x = 10; } // `x` is freed here { - let mut y = Unique::new(5); + let mut y = Unique::new(5i); *y.borrow_mut() = 10; } // `y` is freed here } @@ -678,7 +678,7 @@ unsafe fn deallocate(ptr: *mut u8, _size: uint, _align: uint) { #[start] fn main(argc: int, argv: *const *const u8) -> int { - let x = box 1; + let x = box 1i; 0 } diff --git a/src/doc/intro.md b/src/doc/intro.md index 1e577a9113160..10fd39c841bd6 100644 --- a/src/doc/intro.md +++ b/src/doc/intro.md @@ -133,7 +133,7 @@ Check it out: ``` fn dangling() -> Box { - let i = box 1234; + let i = box 1234i; return i; } @@ -143,8 +143,8 @@ fn add_one() -> int { } ``` -Now instead of a stack allocated `1234`, -we have a heap allocated `box 1234`. +Now instead of a stack allocated `1234i`, +we have a heap allocated `box 1234i`. Whereas `&` borrows a pointer to existing memory, creating an owned box allocates memory on the heap and places a value in it, giving you the sole pointer to that memory. @@ -152,7 +152,7 @@ You can roughly compare these two lines: ``` // Rust -let i = box 1234; +let i = box 1234i; ``` ```cpp diff --git a/src/doc/rust.md b/src/doc/rust.md index c5a6a01f48355..58819a3cf48ee 100644 --- a/src/doc/rust.md +++ b/src/doc/rust.md @@ -442,17 +442,14 @@ of integer literal suffix: The type of an _unsuffixed_ integer literal is determined by type inference. If an integer type can be _uniquely_ determined from the surrounding program context, the unsuffixed integer literal has that type. If the program context -underconstrains the type, the unsuffixed integer literal's type is `int`; if -the program context overconstrains the type, it is considered a static type -error. +underconstrains the type, it is considered a static type error; +if the program context overconstrains the type, +it is also considered a static type error. Examples of integer literals of various forms: ~~~~ -123; 0xff00; // type determined by program context - // defaults to int in absence of type - // information - +123i; // type int 123u; // type uint 123_u; // type uint 0xff_u8; // type u8 @@ -469,8 +466,10 @@ A _floating-point literal_ has one of two forms: second decimal literal. * A single _decimal literal_ followed by an _exponent_. -By default, a floating-point literal has a generic type, but will fall back to -`f64`. A floating-point literal may be followed (immediately, without any +By default, a floating-point literal has a generic type, +and, like integer literals, the type must be uniquely determined +from the context. +A floating-point literal may be followed (immediately, without any spaces) by a _floating-point suffix_, which changes the type of the literal. There are two floating-point suffixes: `f32`, and `f64` (the 32-bit and 64-bit floating point types). @@ -478,8 +477,8 @@ floating point types). Examples of floating-point literals of various forms: ~~~~ -123.0; // type f64 -0.1; // type f64 +123.0f64; // type f64 +0.1f64; // type f64 0.1f32; // type f32 12E+99_f64; // type f64 ~~~~ @@ -2700,9 +2699,9 @@ must be a constant expression that can be evaluated at compile time, such as a [literal](#literals) or a [static item](#static-items). ~~~~ -[1, 2, 3, 4]; +[1i, 2, 3, 4]; ["a", "b", "c", "d"]; -[0, ..128]; // vector with 128 zeros +[0i, ..128]; // vector with 128 zeros [0u8, 0u8, 0u8, 0u8]; ~~~~ @@ -2881,7 +2880,7 @@ equals sign (`=`) and an [rvalue](#lvalues-rvalues-and-temporaries) expression. Evaluating an assignment expression [either copies or moves](#moved-and-copied-types) its right-hand operand to its left-hand operand. ~~~~ -# let mut x = 0; +# let mut x = 0i; # let y = 0; x = y; @@ -2932,7 +2931,7 @@ paren_expr : '(' expr ')' ; An example of a parenthesized expression: ~~~~ -let x = (2 + 3) * 4; +let x: int = (2 + 3) * 4; ~~~~ @@ -3016,7 +3015,7 @@ conditional expression evaluates to `false`, the `while` expression completes. An example: ~~~~ -let mut i = 0; +let mut i = 0u; while i < 10 { println!("hello"); @@ -3262,7 +3261,7 @@ Patterns can also dereference pointers by using the `&`, on `x: &int` are equivalent: ~~~~ -# let x = &3; +# let x = &3i; let y = match *x { 0 => "zero", _ => "some" }; let z = match x { &0 => "zero", _ => "some" }; @@ -3285,7 +3284,7 @@ A range of values may be specified with `..`. For example: ~~~~ -# let x = 2; +# let x = 2i; let message = match x { 0 | 1 => "not many", diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md index 456726984bc04..5fe6a5f14c2b4 100644 --- a/src/doc/tutorial.md +++ b/src/doc/tutorial.md @@ -262,7 +262,7 @@ write function, variable, and module names with lowercase letters, using underscores where they help readability, while writing types in camel case. ~~~ -let my_variable = 100; +let my_variable = 100i; type MyType = int; // primitive types are _not_ camel case ~~~ @@ -276,7 +276,7 @@ write a piece of code like this: ~~~~ # let item = "salad"; -let price; +let price: f64; if item == "salad" { price = 3.50; } else if item == "muffin" { @@ -290,7 +290,7 @@ But, in Rust, you don't have to repeat the name `price`: ~~~~ # let item = "salad"; -let price = +let price: f64 = if item == "salad" { 3.50 } else if item == "muffin" { @@ -337,11 +337,10 @@ suffix that can be used to indicate the type of a literal: `i` for `int`, In the absence of an integer literal suffix, Rust will infer the integer type based on type annotations and function signatures in the surrounding program. In the absence of any type information at all, -Rust will assume that an unsuffixed integer literal has type -`int`. +Rust will report an error and request that the type be specified explicitly. ~~~~ -let a = 1; // `a` is an `int` +let a: int = 1; // `a` is an `int` let b = 10i; // `b` is an `int`, due to the `i` suffix let c = 100u; // `c` is a `uint` let d = 1000i32; // `d` is an `i32` @@ -475,7 +474,7 @@ against each pattern in order until one matches. The matching pattern executes its corresponding arm. ~~~~ -let my_number = 1; +let my_number = 1i; match my_number { 0 => println!("zero"), 1 | 2 => println!("one or two"), @@ -501,7 +500,7 @@ matches any single value. (`..`) is a different wildcard that can match one or more fields in an `enum` variant. ~~~ -# let my_number = 1; +# let my_number = 1i; match my_number { 0 => { println!("zero") } _ => { println!("something else") } @@ -584,7 +583,7 @@ keyword `break` aborts the loop, and `continue` aborts the current iteration and continues with the next. ~~~~ -let mut cake_amount = 8; +let mut cake_amount = 8i; while cake_amount > 0 { cake_amount -= 1; } @@ -944,7 +943,7 @@ The `box` operator performs memory allocation on the heap: ~~~~ { // an integer allocated on the heap - let y = box 10; + let y = box 10i; } // the destructor frees the heap memory as soon as `y` goes out of scope ~~~~ @@ -1165,7 +1164,7 @@ let z = x; The mutability of a value may be changed by moving it to a new owner: ~~~~ -let r = box 13; +let r = box 13i; let mut s = r; // box becomes mutable *s += 1; let t = s; // box becomes immutable @@ -1285,9 +1284,9 @@ Using the generic `List` works much like before, thanks to type inference: # Cons(value, box xs) # } let mut xs = Nil; // Unknown type! This is a `List`, but `T` can be anything. -xs = prepend(xs, 10); // Here the compiler infers `xs`'s type as `List`. -xs = prepend(xs, 15); -xs = prepend(xs, 20); +xs = prepend(xs, 10i); // Here the compiler infers `xs`'s type as `List`. +xs = prepend(xs, 15i); +xs = prepend(xs, 20i); ~~~ The code sample above demonstrates type inference making most type annotations optional. It is @@ -1410,12 +1409,12 @@ Beyond the properties granted by the size, an owned box behaves as a regular value by inheriting the mutability and lifetime of the owner: ~~~~ -let x = 5; // immutable -let mut y = 5; // mutable +let x = 5i; // immutable +let mut y = 5i; // mutable y += 2; -let x = box 5; // immutable -let mut y = box 5; // mutable +let x = box 5i; // immutable +let mut y = box 5i; // mutable *y += 2; // the `*` operator is needed to access the contained value ~~~~ @@ -1507,7 +1506,7 @@ freezing enforced statically at compile-time. An example of a non-`Freeze` type is [`RefCell`][refcell]. ~~~~ -let mut x = 5; +let mut x = 5i; { let y = &x; // `x` is now frozen. It cannot be modified or re-assigned. } @@ -1523,8 +1522,8 @@ Rust uses the unary star operator (`*`) to access the contents of a box or pointer, similarly to C. ~~~ -let owned = box 10; -let borrowed = &20; +let owned = box 10i; +let borrowed = &20i; let sum = *owned + *borrowed; ~~~ @@ -1534,9 +1533,9 @@ assignments. Such an assignment modifies the value that the pointer points to. ~~~ -let mut owned = box 10; +let mut owned = box 10i; -let mut value = 20; +let mut value = 20i; let borrowed = &mut value; *owned = *borrowed + 100; @@ -1654,12 +1653,12 @@ Unicode code points, so they cannot be freely mutated without the ability to alter the length. ~~~ -let mut xs = [1, 2, 3]; +let mut xs = [1i, 2i, 3i]; let view = xs.mut_slice(0, 2); view[0] = 5; // The type of a mutable slice is written as `&mut [T]` -let ys: &mut [int] = &mut [1, 2, 3]; +let ys: &mut [int] = &mut [1i, 2i, 3i]; ~~~ Square brackets denote indexing into a slice or fixed-size vector: diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 6af4083edb2ce..38ed511c4589a 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -376,14 +376,14 @@ mod tests { #[test] fn test_live() { - let x = Arc::new(5); + let x = Arc::new(5i); let y = x.downgrade(); assert!(y.upgrade().is_some()); } #[test] fn test_dead() { - let x = Arc::new(5); + let x = Arc::new(5i); let y = x.downgrade(); drop(x); assert!(y.upgrade().is_none()); diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs index 589ff8c1de9fe..dc8280e9b8361 100644 --- a/src/liballoc/heap.rs +++ b/src/liballoc/heap.rs @@ -329,7 +329,7 @@ mod bench { #[bench] fn alloc_owned_small(b: &mut Bencher) { b.iter(|| { - box 10 + box 10i }) } } diff --git a/src/libcollections/hash/mod.rs b/src/libcollections/hash/mod.rs index 976f726244121..e3d1c9a3216bc 100644 --- a/src/libcollections/hash/mod.rs +++ b/src/libcollections/hash/mod.rs @@ -342,12 +342,12 @@ mod tests { assert_eq!(hasher.hash(& &[1u8, 2u8, 3u8]), 9); unsafe { - let ptr: *const int = mem::transmute(5); + let ptr: *const int = mem::transmute(5i); assert_eq!(hasher.hash(&ptr), 5); } unsafe { - let ptr: *mut int = mem::transmute(5); + let ptr: *mut int = mem::transmute(5i); assert_eq!(hasher.hash(&ptr), 5); } } diff --git a/src/libcollections/ringbuf.rs b/src/libcollections/ringbuf.rs index be0d603696bec..5e19accdd6715 100644 --- a/src/libcollections/ringbuf.rs +++ b/src/libcollections/ringbuf.rs @@ -572,7 +572,7 @@ mod tests { fn bench_push_back(b: &mut test::Bencher) { let mut deq = RingBuf::new(); b.iter(|| { - deq.push_back(0); + deq.push_back(0i); }) } @@ -580,7 +580,7 @@ mod tests { fn bench_push_front(b: &mut test::Bencher) { let mut deq = RingBuf::new(); b.iter(|| { - deq.push_front(0); + deq.push_front(0i); }) } @@ -589,7 +589,7 @@ mod tests { let mut deq = RingBuf::new(); b.iter(|| { for _ in range(0i, 65) { - deq.push_front(1); + deq.push_front(1i); } }) } @@ -651,10 +651,10 @@ mod tests { #[test] fn test_with_capacity() { let mut d = RingBuf::with_capacity(0); - d.push_back(1); + d.push_back(1i); assert_eq!(d.len(), 1); let mut d = RingBuf::with_capacity(50); - d.push_back(1); + d.push_back(1i); assert_eq!(d.len(), 1); } diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index ac32d93edbe83..40cf8495a4059 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -17,7 +17,7 @@ Vectors are Rust's list type. Vectors contain zero or more values of homogeneous types: ```rust -let int_vector = [1,2,3]; +let int_vector = [1i, 2i, 3i]; let str_vector = ["one", "two", "three"]; ``` @@ -41,9 +41,9 @@ An example is the method `.slice(a, b)` that returns an immutable "view" into a vector or a vector slice from the index interval `[a, b)`: ```rust -let numbers = [0, 1, 2]; +let numbers = [0i, 1i, 2i]; let last_numbers = numbers.slice(1, 3); -// last_numbers is now &[1, 2] +// last_numbers is now &[1i, 2i] ``` Traits defined for the `~[T]` type, like `OwnedVector`, can only be called @@ -54,9 +54,9 @@ An example is the method `.push(element)` that will add an element at the end of the vector: ```rust -let mut numbers = vec![0, 1, 2]; +let mut numbers = vec![0i, 1i, 2i]; numbers.push(7); -// numbers is now vec![0, 1, 2, 7]; +// numbers is now vec![0i, 1i, 2i, 7i]; ``` ## Implementations of other traits @@ -779,7 +779,7 @@ mod tests { fn test_is_empty() { let xs: [int, ..0] = []; assert!(xs.is_empty()); - assert!(![0].is_empty()); + assert!(![0i].is_empty()); } #[test] @@ -1528,7 +1528,7 @@ mod tests { fn test_permute_fail() { let v = [(box 0i, Rc::new(0i)), (box 0i, Rc::new(0i)), (box 0i, Rc::new(0i)), (box 0i, Rc::new(0i))]; - let mut i = 0; + let mut i = 0u; for _ in v.permutations() { if i == 2 { fail!() @@ -1870,16 +1870,16 @@ mod tests { fn test_overflow_does_not_cause_segfault() { let mut v = vec![]; v.reserve_exact(-1); - v.push(1); + v.push(1i); v.push(2); } #[test] #[should_fail] fn test_overflow_does_not_cause_segfault_managed() { - let mut v = vec![Rc::new(1)]; + let mut v = vec![Rc::new(1i)]; v.reserve_exact(-1); - v.push(Rc::new(2)); + v.push(Rc::new(2i)); } #[test] @@ -2279,7 +2279,7 @@ mod bench { v.set_len(1024); } for x in v.mut_iter() { - *x = 0; + *x = 0i; } v }); diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 72c5aff675bfb..2d84c733b09e9 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -1103,7 +1103,7 @@ mod tests { assert_eq!("bc", unsafe {raw::slice_bytes("abc", 1, 3)}); assert_eq!("", unsafe {raw::slice_bytes("abc", 1, 1)}); fn a_million_letter_a() -> String { - let mut i = 0; + let mut i = 0u; let mut rs = String::new(); while i < 100000 { rs.push_str("aaaaaaaaaa"); @@ -1112,7 +1112,7 @@ mod tests { rs } fn half_a_million_letter_a() -> String { - let mut i = 0; + let mut i = 0u; let mut rs = String::new(); while i < 100000 { rs.push_str("aaaaa"); @@ -1220,7 +1220,7 @@ mod tests { assert_eq!("华", data.slice(30, 33)); fn a_million_letter_x() -> String { - let mut i = 0; + let mut i = 0u; let mut rs = String::new(); while i < 100000 { rs.push_str("华华华华华华华华华华"); @@ -1229,7 +1229,7 @@ mod tests { rs } fn half_a_million_letter_x() -> String { - let mut i = 0; + let mut i = 0u; let mut rs = String::new(); while i < 100000 { rs.push_str("华华华华华"); diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index ab701b76026f4..8cd65c4f56466 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -67,10 +67,10 @@ //! //! fn main() { //! let shared_map: Rc> = Rc::new(RefCell::new(HashMap::new())); -//! shared_map.borrow_mut().insert("africa", 92388); -//! shared_map.borrow_mut().insert("kyoto", 11837); -//! shared_map.borrow_mut().insert("piccadilly", 11826); -//! shared_map.borrow_mut().insert("marbles", 38); +//! shared_map.borrow_mut().insert("africa", 92388i); +//! shared_map.borrow_mut().insert("kyoto", 11837i); +//! shared_map.borrow_mut().insert("piccadilly", 11826i); +//! shared_map.borrow_mut().insert("marbles", 38i); //! } //! ``` //! @@ -433,35 +433,35 @@ mod test { #[test] fn double_imm_borrow() { - let x = RefCell::new(0); + let x = RefCell::new(0i); let _b1 = x.borrow(); x.borrow(); } #[test] fn no_mut_then_imm_borrow() { - let x = RefCell::new(0); + let x = RefCell::new(0i); let _b1 = x.borrow_mut(); assert!(x.try_borrow().is_none()); } #[test] fn no_imm_then_borrow_mut() { - let x = RefCell::new(0); + let x = RefCell::new(0i); let _b1 = x.borrow(); assert!(x.try_borrow_mut().is_none()); } #[test] fn no_double_borrow_mut() { - let x = RefCell::new(0); + let x = RefCell::new(0i); let _b1 = x.borrow_mut(); assert!(x.try_borrow_mut().is_none()); } #[test] fn imm_release_borrow_mut() { - let x = RefCell::new(0); + let x = RefCell::new(0i); { let _b1 = x.borrow(); } @@ -470,7 +470,7 @@ mod test { #[test] fn mut_release_borrow_mut() { - let x = RefCell::new(0); + let x = RefCell::new(0i); { let _b1 = x.borrow_mut(); } @@ -479,7 +479,7 @@ mod test { #[test] fn double_borrow_single_release_no_borrow_mut() { - let x = RefCell::new(0); + let x = RefCell::new(0i); let _b1 = x.borrow(); { let _b2 = x.borrow(); @@ -490,7 +490,7 @@ mod test { #[test] #[should_fail] fn discard_doesnt_unborrow() { - let x = RefCell::new(0); + let x = RefCell::new(0i); let _b = x.borrow(); let _ = _b; let _b = x.borrow_mut(); @@ -499,7 +499,7 @@ mod test { #[test] #[allow(experimental)] fn clone_ref_updates_flag() { - let x = RefCell::new(0); + let x = RefCell::new(0i); { let b1 = x.borrow(); assert!(x.try_borrow_mut().is_none()); diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index d7a3edccfd822..197997507a6c6 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -86,11 +86,11 @@ pub trait Eq: PartialEq { #[deriving(Clone, PartialEq, Show)] pub enum Ordering { /// An ordering where a compared value is less [than another]. - Less = -1, + Less = -1i, /// An ordering where a compared value is equal [to another]. - Equal = 0, + Equal = 0i, /// An ordering where a compared value is greater [than another]. - Greater = 1 + Greater = 1i, } /// Trait for types that form a [total order]( diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 1a66d952e9bc2..1096758a22d96 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -686,7 +686,7 @@ macro_rules! tuple ( fn fmt(&self, f: &mut Formatter) -> Result { try!(write!(f, "(")); let ($(ref $name,)*) = *self; - let mut n = 0; + let mut n = 0i; $( if n > 0 { try!(write!(f, ", ")); diff --git a/src/libcore/fmt/num.rs b/src/libcore/fmt/num.rs index 56d0817dd00be..d3edfd42febfd 100644 --- a/src/libcore/fmt/num.rs +++ b/src/libcore/fmt/num.rs @@ -388,7 +388,7 @@ mod tests { #[test] #[should_fail] fn test_radix_base_too_large() { - let _ = radix(55, 37); + let _ = radix(55i, 37); } } diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index ec53ef93dc1dd..c041ef5706ba2 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -2649,10 +2649,10 @@ mod tests { assert_eq!(c.enumerate().size_hint(), (uint::MAX, None)); assert_eq!(c.chain(vi.map(|&i| i)).size_hint(), (uint::MAX, None)); assert_eq!(c.zip(vi).size_hint(), (10, Some(10))); - assert_eq!(c.scan(0, |_,_| Some(0)).size_hint(), (0, None)); + assert_eq!(c.scan(0i, |_,_| Some(0i)).size_hint(), (0, None)); assert_eq!(c.filter(|_| false).size_hint(), (0, None)); - assert_eq!(c.map(|_| 0).size_hint(), (uint::MAX, None)); - assert_eq!(c.filter_map(|_| Some(0)).size_hint(), (0, None)); + assert_eq!(c.map(|_| 0i).size_hint(), (uint::MAX, None)); + assert_eq!(c.filter_map(|_| Some(0i)).size_hint(), (0, None)); assert_eq!(vi.take(5).size_hint(), (5, Some(5))); assert_eq!(vi.take(12).size_hint(), (10, Some(10))); @@ -2663,10 +2663,10 @@ mod tests { assert_eq!(vi.enumerate().size_hint(), (10, Some(10))); assert_eq!(vi.chain(v2.iter()).size_hint(), (13, Some(13))); assert_eq!(vi.zip(v2.iter()).size_hint(), (3, Some(3))); - assert_eq!(vi.scan(0, |_,_| Some(0)).size_hint(), (0, Some(10))); + assert_eq!(vi.scan(0i, |_,_| Some(0i)).size_hint(), (0, Some(10))); assert_eq!(vi.filter(|_| false).size_hint(), (0, Some(10))); assert_eq!(vi.map(|i| i+1).size_hint(), (10, Some(10))); - assert_eq!(vi.filter_map(|_| Some(0)).size_hint(), (0, Some(10))); + assert_eq!(vi.filter_map(|_| Some(0i)).size_hint(), (0, Some(10))); } #[test] diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index d1e2084243d41..39ec830179cb5 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -475,7 +475,7 @@ mod tests { #[test] fn test_transmute_copy() { - assert_eq!(1u, unsafe { ::mem::transmute_copy(&1) }); + assert_eq!(1u, unsafe { ::mem::transmute_copy(&1i) }); } #[test] @@ -541,7 +541,7 @@ mod bench { #[bench] fn match_option_some(b: &mut Bencher) { - let x = Some(10); + let x = Some(10i); b.iter(|| { match x { Some(y) => y, @@ -552,11 +552,11 @@ mod bench { #[bench] fn match_vec_pattern(b: &mut Bencher) { - let x = [1,2,3,4,5,6]; + let x = [1i,2,3,4,5,6]; b.iter(|| { match x { - [1,2,3,..] => 10, - _ => 11 + [1,2,3,..] => 10i, + _ => 11i, } }); } diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 9748235e94a13..949e6a5b9a072 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -627,7 +627,7 @@ mod tests { #[test] fn test_get_ptr() { unsafe { - let x = box 0; + let x = box 0i; let addr_x: *const int = ::mem::transmute(&*x); let opt = Some(x); let y = opt.unwrap(); @@ -750,7 +750,7 @@ mod tests { #[test] fn test_option_while_some() { let mut i = 0i; - Some(10).while_some(|j| { + Some(10i).while_some(|j| { i += 1; if j > 0 { Some(j-1) diff --git a/src/libdebug/repr.rs b/src/libdebug/repr.rs index 1494a2defe949..133353ec3d717 100644 --- a/src/libdebug/repr.rs +++ b/src/libdebug/repr.rs @@ -588,22 +588,22 @@ fn test_repr() { assert_eq!(s.as_slice(), e); } - exact_test(&10, "10"); + exact_test(&10i, "10"); exact_test(&true, "true"); exact_test(&false, "false"); - exact_test(&1.234, "1.234f64"); + exact_test(&1.234f64, "1.234f64"); exact_test(&("hello"), "\"hello\""); - exact_test(&(box(GC) 10), "box(GC) 10"); - exact_test(&(box 10), "box 10"); - exact_test(&(&10), "&10"); - let mut x = 10; + exact_test(&(box(GC) 10i), "box(GC) 10"); + exact_test(&(box 10i), "box 10"); + exact_test(&(&10i), "&10"); + let mut x = 10i; exact_test(&(&mut x), "&mut 10"); - exact_test(&(0 as *const ()), "(0x0 as *const ())"); - exact_test(&(0 as *mut ()), "(0x0 as *mut ())"); + exact_test(&(0i as *const()), "(0x0 as *const ())"); + exact_test(&(0i as *mut ()), "(0x0 as *mut ())"); - exact_test(&(1,), "(1,)"); + exact_test(&(1i,), "(1,)"); exact_test(&(&["hi", "there"]), "&[\"hi\", \"there\"]"); exact_test(&(P{a:10, b:1.234}), @@ -613,8 +613,8 @@ fn test_repr() { exact_test(&(box P{a:10, b:1.234}), "box repr::P{a: 10, b: 1.234f64}"); - exact_test(&(&[1, 2]), "&[1, 2]"); - exact_test(&(&mut [1, 2]), "&mut [1, 2]"); + exact_test(&(&[1i, 2i]), "&[1, 2]"); + exact_test(&(&mut [1i, 2i]), "&mut [1, 2]"); exact_test(&'\'', "'\\''"); exact_test(&'"', "'\"'"); diff --git a/src/libgreen/sched.rs b/src/libgreen/sched.rs index c5130a542fc82..7603b0a8013c7 100644 --- a/src/libgreen/sched.rs +++ b/src/libgreen/sched.rs @@ -1413,7 +1413,7 @@ mod test { impl Drop for S { fn drop(&mut self) { - let _foo = box 0; + let _foo = box 0i; } } diff --git a/src/libhexfloat/lib.rs b/src/libhexfloat/lib.rs index 351afc1c5d4e9..1b43f236e69b5 100644 --- a/src/libhexfloat/lib.rs +++ b/src/libhexfloat/lib.rs @@ -77,12 +77,12 @@ fn hex_float_lit_err(s: &str) -> Option<(uint, String)> { if chars.next() != Some('x') { return Some((i, "Expected 'x'".to_string())); } i+=1; - let mut d_len = 0; + let mut d_len = 0i; for _ in chars.take_while(|c| c.is_digit_radix(16)) { chars.next(); i+=1; d_len += 1;} if chars.next() != Some('.') { return Some((i, "Expected '.'".to_string())); } i+=1; - let mut f_len = 0; + let mut f_len = 0i; for _ in chars.take_while(|c| c.is_digit_radix(16)) { chars.next(); i+=1; f_len += 1;} if d_len == 0 && f_len == 0 { return Some((i, "Expected digits before or after decimal \ @@ -92,7 +92,7 @@ fn hex_float_lit_err(s: &str) -> Option<(uint, String)> { return Some((i, "Expected 'p'".to_string())); } i+=1; if chars.peek() == Some(&'-') { chars.next(); i+= 1 } - let mut e_len = 0; + let mut e_len = 0i; for _ in chars.take_while(|c| c.is_digit()) { chars.next(); i+=1; e_len += 1} if e_len == 0 { return Some((i, "Expected exponent digits".to_string())); diff --git a/src/libnative/io/process.rs b/src/libnative/io/process.rs index 00448b91dbd34..b1c0d9a150693 100644 --- a/src/libnative/io/process.rs +++ b/src/libnative/io/process.rs @@ -1136,7 +1136,7 @@ fn waitpid(pid: pid_t, deadline: u64) -> IoResult { // which will wake up the other end at some point, so we just allow this // signal to be coalesced with the pending signals on the pipe. extern fn sigchld_handler(_signum: libc::c_int) { - let msg = 1; + let msg = 1i; match unsafe { libc::write(WRITE_FD, &msg as *const _ as *const libc::c_void, 1) } { diff --git a/src/libnum/bigint.rs b/src/libnum/bigint.rs index 06e4792cdcccf..9011aafc009d3 100644 --- a/src/libnum/bigint.rs +++ b/src/libnum/bigint.rs @@ -215,7 +215,7 @@ impl Sub for BigUint { let zeros = ZERO_VEC.iter().cycle(); let (a, b) = (self.data.iter().chain(zeros.clone()), other.data.iter().chain(zeros)); - let mut borrow = 0; + let mut borrow = 0i; let diff: Vec = a.take(new_len).zip(b).map(|(ai, bi)| { let (hi, lo) = BigDigit::from_doublebigdigit( BigDigit::base diff --git a/src/librand/isaac.rs b/src/librand/isaac.rs index 6caa936636a71..134e7af507010 100644 --- a/src/librand/isaac.rs +++ b/src/librand/isaac.rs @@ -389,10 +389,10 @@ impl Isaac64Rng { } }} ); - rngstepp!(0, 21); - rngstepn!(1, 5); - rngstepp!(2, 12); - rngstepn!(3, 33); + rngstepp!(0u, 21); + rngstepn!(1u, 5); + rngstepp!(2u, 12); + rngstepn!(3u, 33); } } diff --git a/src/librand/lib.rs b/src/librand/lib.rs index 769b23a7e7bf9..ae1a10f620663 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -111,7 +111,7 @@ pub trait Rng { // (3) adds more `unsafe` that needs to be checked, (4) // probably doesn't give much performance gain if // optimisations are on. - let mut count = 0; + let mut count = 0i; let mut num = 0; for byte in dest.mut_iter() { if count == 0 { diff --git a/src/libregex/parse/mod.rs b/src/libregex/parse/mod.rs index 2fea75746be73..9cde40c196088 100644 --- a/src/libregex/parse/mod.rs +++ b/src/libregex/parse/mod.rs @@ -770,7 +770,7 @@ impl<'a> Parser<'a> { } let start = self.chari; let mut flags = self.flags; - let mut sign = 1; + let mut sign = 1i; let mut saw_flag = false; loop { try!(self.noteof("expected non-empty set of flags or closing ')'")) diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs index 339db67b3f1a1..b562d48f49d32 100644 --- a/src/librustc/lint/builtin.rs +++ b/src/librustc/lint/builtin.rs @@ -391,8 +391,8 @@ pub struct HeapMemory; impl HeapMemory { fn check_heap_type(&self, cx: &Context, span: Span, ty: ty::t) { - let mut n_box = 0; - let mut n_uniq = 0; + let mut n_box = 0i; + let mut n_uniq = 0i; ty::fold_ty(cx.tcx, ty, |t| { match ty::get(t).sty { ty::ty_box(_) => { diff --git a/src/librustc/middle/save/span_utils.rs b/src/librustc/middle/save/span_utils.rs index e646827fa23dd..57006d5e72b9b 100644 --- a/src/librustc/middle/save/span_utils.rs +++ b/src/librustc/middle/save/span_utils.rs @@ -90,7 +90,7 @@ impl<'a> SpanUtils<'a> { let mut result = None; let mut toks = self.retokenise_span(span); - let mut bracket_count = 0; + let mut bracket_count = 0u; loop { let ts = toks.next_token(); if ts.tok == token::EOF { @@ -113,7 +113,7 @@ impl<'a> SpanUtils<'a> { // Return the span for the first identifier in the path. pub fn span_for_first_ident(&self, span: Span) -> Option { let mut toks = self.retokenise_span(span); - let mut bracket_count = 0; + let mut bracket_count = 0u; loop { let ts = toks.next_token(); if ts.tok == token::EOF { @@ -139,7 +139,7 @@ impl<'a> SpanUtils<'a> { let mut toks = self.retokenise_span(span); let mut prev = toks.next_token(); let mut result = None; - let mut bracket_count = 0; + let mut bracket_count = 0u; let mut last_span = None; while prev.tok != token::EOF { last_span = None; @@ -187,7 +187,7 @@ impl<'a> SpanUtils<'a> { let mut toks = self.retokenise_span(span); let mut prev = toks.next_token(); let mut result = None; - let mut bracket_count = 0; + let mut bracket_count = 0u; loop { let next = toks.next_token(); @@ -232,7 +232,7 @@ impl<'a> SpanUtils<'a> { let mut toks = self.retokenise_span(span); // We keep track of how many brackets we're nested in - let mut bracket_count = 0; + let mut bracket_count = 0i; loop { let ts = toks.next_token(); if ts.tok == token::EOF { @@ -291,7 +291,7 @@ impl<'a> SpanUtils<'a> { let mut next = toks.next_token(); let mut stored_val = false; let mut found_val = false; - let mut bracket_count = 0; + let mut bracket_count = 0u; while next.tok != token::EOF { if bracket_count == 1 { if next.tok == tok2 { diff --git a/src/librustc/middle/trans/foreign.rs b/src/librustc/middle/trans/foreign.rs index fcd6c7e293ea2..488dc6d99e35c 100644 --- a/src/librustc/middle/trans/foreign.rs +++ b/src/librustc/middle/trans/foreign.rs @@ -957,7 +957,11 @@ pub fn lltype_for_foreign_fn(ccx: &CrateContext, ty: ty::t) -> Type { fn add_argument_attributes(tys: &ForeignTypes, llfn: ValueRef) { - let mut i = if tys.fn_ty.ret_ty.is_indirect() { 1 } else { 0 }; + let mut i = if tys.fn_ty.ret_ty.is_indirect() { + 1i + } else { + 0i + }; match tys.fn_ty.ret_ty.attr { Some(attr) => unsafe { diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index bb20c3ce0b4aa..d808120db99ba 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -3805,7 +3805,15 @@ pub fn check_enum_variants(ccx: &CrateCtxt, let inh = blank_inherited_fields(ccx); let fcx = blank_fn_ctxt(ccx, &inh, rty, e.id); - let declty = ty::mk_int_var(ccx.tcx, fcx.infcx().next_int_var_id()); + let declty = match hint { + attr::ReprAny | attr::ReprExtern => ty::mk_int(), + attr::ReprInt(_, attr::SignedInt(ity)) => { + ty::mk_mach_int(ity) + } + attr::ReprInt(_, attr::UnsignedInt(ity)) => { + ty::mk_mach_uint(ity) + } + }; check_const_with_ty(&fcx, e.span, &*e, declty); // check_expr (from check_const pass) doesn't guarantee // that the expression is in a form that eval_const_expr can diff --git a/src/librustc/middle/typeck/infer/mod.rs b/src/librustc/middle/typeck/infer/mod.rs index 197a2370eff9e..bc02297b5b1f3 100644 --- a/src/librustc/middle/typeck/infer/mod.rs +++ b/src/librustc/middle/typeck/infer/mod.rs @@ -247,9 +247,13 @@ pub enum fixup_err { pub fn fixup_err_to_str(f: fixup_err) -> String { match f { - unresolved_int_ty(_) => "unconstrained integral type".to_string(), + unresolved_int_ty(_) => { + "cannot determine the type of this integer; add a suffix to \ + specify the type explicitly".to_string() + } unresolved_float_ty(_) => { - "unconstrained floating point type".to_string() + "cannot determine the type of this number; add a suffix to specify \ + the type explicitly".to_string() } unresolved_ty(_) => "unconstrained type".to_string(), cyclic_ty(_) => "cyclic type of infinite size".to_string(), diff --git a/src/librustc/middle/typeck/infer/resolve.rs b/src/librustc/middle/typeck/infer/resolve.rs index ed6ea6c96775e..adfbe9de2d5bf 100644 --- a/src/librustc/middle/typeck/infer/resolve.rs +++ b/src/librustc/middle/typeck/infer/resolve.rs @@ -52,14 +52,12 @@ use middle::ty::{type_is_bot, IntType, UintType}; use middle::ty; use middle::ty_fold; use middle::typeck::infer::{Bounds, cyclic_ty, fixup_err, fres, InferCtxt}; -use middle::typeck::infer::unresolved_ty; -use middle::typeck::infer::unify::Root; +use middle::typeck::infer::{unresolved_float_ty, unresolved_int_ty}; +use middle::typeck::infer::{unresolved_ty}; use syntax::codemap::Span; use util::common::indent; use util::ppaux::{Repr, ty_to_str}; -use syntax::ast; - pub static resolve_nested_tvar: uint = 0b0000000001; pub static resolve_rvar: uint = 0b0000000010; pub static resolve_ivar: uint = 0b0000000100; @@ -83,21 +81,18 @@ pub struct ResolveState<'a> { err: Option, v_seen: Vec , type_depth: uint, - span: Option, } pub fn resolver<'a>(infcx: &'a InferCtxt, modes: uint, - span: Option) - -> ResolveState<'a> -{ + _: Option) + -> ResolveState<'a> { ResolveState { infcx: infcx, modes: modes, err: None, v_seen: Vec::new(), type_depth: 0, - span: span } } @@ -258,24 +253,10 @@ impl<'a> ResolveState<'a> { Some(UintType(t)) => ty::mk_mach_uint(t), None => { if self.should(force_ivar) { - // As a last resort, default to int and emit an error. - let ty = ty::mk_int(); - table.borrow_mut().set( - tcx, node.key, Root(Some(IntType(ast::TyI)), node.rank)); - - match self.span { - Some(sp) => { - self.infcx.tcx.sess.span_err( - sp, - "cannot determine the type of this integer; add \ - a suffix to specify the type explicitly"); - } - None => { } - } - ty - } else { - ty::mk_int_var(self.infcx.tcx, vid) + // As a last resort, emit an error. + self.err = Some(unresolved_int_ty(vid)); } + ty::mk_int_var(self.infcx.tcx, vid) } } } @@ -292,24 +273,10 @@ impl<'a> ResolveState<'a> { Some(t) => ty::mk_mach_float(t), None => { if self.should(force_fvar) { - // As a last resort, default to f64 and emit an error. - let ty = ty::mk_f64(); - table.borrow_mut().set( - tcx, node.key, Root(Some(ast::TyF64), node.rank)); - - match self.span { - Some(sp) => { - self.infcx.tcx.sess.span_err( - sp, - "cannot determine the type of this number; add \ - a suffix to specify the type explicitly"); - } - None => { } - } - ty - } else { - ty::mk_float_var(self.infcx.tcx, vid) + // As a last resort, emit an error. + self.err = Some(unresolved_float_ty(vid)); } + ty::mk_float_var(self.infcx.tcx, vid) } } } diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 1173f6eb5b8b4..fa18b6291be74 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -185,7 +185,7 @@ fn path(w: &mut fmt::Formatter, path: &clean::Path, print_all: bool, let mut generics = String::new(); let last = path.segments.last().unwrap(); if last.lifetimes.len() > 0 || last.types.len() > 0 { - let mut counter = 0; + let mut counter = 0u; generics.push_str("<"); for lifetime in last.lifetimes.iter() { if counter > 0 { generics.push_str(", "); } diff --git a/src/librustrt/local_heap.rs b/src/librustrt/local_heap.rs index aca9e46d2f4a0..273505c416a3c 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 a0140129c0b40..813ea0f30f38b 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 = 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 = 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 6e27310f09ac9..891d0d5a8e359 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 e1db67140aad7..3b9ee31d8e507 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 = 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 = transmute(get(key)); - assert_eq!(value, box 30); + assert_eq!(value, box 30i); } } } diff --git a/src/librustuv/net.rs b/src/librustuv/net.rs index f1c37762129a3..45cf7ec8e5eec 100644 --- a/src/librustuv/net.rs +++ b/src/librustuv/net.rs @@ -1160,7 +1160,7 @@ mod test { let expected = 32; let mut current = 0; - let mut reads = 0; + let mut reads = 0u; while current < expected { let nread = stream.read(buf).ok().unwrap(); diff --git a/src/librustuv/queue.rs b/src/librustuv/queue.rs index 902e2b0bd192f..baaf1150ce085 100644 --- a/src/librustuv/queue.rs +++ b/src/librustuv/queue.rs @@ -176,7 +176,7 @@ impl Drop for Queue { impl Drop for State { fn drop(&mut self) { unsafe { - uvll::uv_close(self.handle, mem::transmute(0)); + uvll::uv_close(self.handle, mem::transmute(0u)); // Note that this does *not* free the handle, that is the // responsibility of the caller because the uv loop must be closed // before we deallocate this uv handle. diff --git a/src/libserialize/base64.rs b/src/libserialize/base64.rs index ee1e836112e3d..63cfbd6d9aa17 100644 --- a/src/libserialize/base64.rs +++ b/src/libserialize/base64.rs @@ -208,7 +208,7 @@ impl<'a> FromBase64 for &'a str { fn from_base64(&self) -> Result, FromBase64Error> { let mut r = Vec::new(); let mut buf: u32 = 0; - let mut modulus = 0; + let mut modulus = 0i; let mut it = self.bytes().enumerate(); for (idx, byte) in it { diff --git a/src/libserialize/hex.rs b/src/libserialize/hex.rs index 2fccbc2fcaf20..51fab7b135458 100644 --- a/src/libserialize/hex.rs +++ b/src/libserialize/hex.rs @@ -104,7 +104,7 @@ impl<'a> FromHex for &'a str { fn from_hex(&self) -> Result, FromHexError> { // This may be an overestimate if there is any whitespace let mut b = Vec::with_capacity(self.len() / 2); - let mut modulus = 0; + let mut modulus = 0i; let mut buf = 0u8; for (idx, byte) in self.bytes().enumerate() { diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 9c91bd4b7e1a7..d8dd2938b34f6 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -3424,7 +3424,7 @@ mod tests { hash_map.insert("a".to_string(), 1i); hash_map.insert("b".to_string(), 2); assert_eq!(hash_map.to_json(), object); - assert_eq!(Some(15i).to_json(), Number(15 as f64)); + assert_eq!(Some(15i).to_json(), Number(15f64)); assert_eq!(None::.to_json(), Null); } diff --git a/src/libstd/io/fs.rs b/src/libstd/io/fs.rs index d8e04f1823938..bc8447dfa2ee9 100644 --- a/src/libstd/io/fs.rs +++ b/src/libstd/io/fs.rs @@ -1051,7 +1051,7 @@ mod test { let initial_msg = "food-is-yummy"; let overwrite_msg = "-the-bar!!"; let final_msg = "foo-the-bar!!"; - let seek_idx = 3; + let seek_idx = 3i; let mut read_mem = [0, .. 13]; let tmpdir = tmpdir(); let filename = &tmpdir.join("file_rt_io_file_test_seek_and_write.txt"); diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 90f4cbb25778d..e0ed8cf667b38 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -1816,7 +1816,7 @@ mod tests { #[ignore] fn test_getenv_big() { let mut s = "".to_string(); - let mut i = 0; + let mut i = 0i; while i < 100 { s.push_str("aaaaaaaaaa"); i += 1; diff --git a/src/libsync/atomics.rs b/src/libsync/atomics.rs index 8ce17b9bf3b64..195efb844a783 100644 --- a/src/libsync/atomics.rs +++ b/src/libsync/atomics.rs @@ -143,7 +143,7 @@ impl AtomicOption { /// Remove the value, leaving the `AtomicOption` empty. #[inline] pub fn take(&self, order: Ordering) -> Option> { - unsafe { self.swap(mem::transmute(0), order) } + unsafe { self.swap(mem::transmute(0u), order) } } /// Replace an empty value with a non-empty value. @@ -155,7 +155,7 @@ impl AtomicOption { pub fn fill(&self, val: Box, order: Ordering) -> Option> { unsafe { let val = mem::transmute(val); - let expected = mem::transmute(0); + let expected = mem::transmute(0u); let oldval = self.p.compare_and_swap(expected, val, order); if oldval == expected { None diff --git a/src/libsync/comm/duplex.rs b/src/libsync/comm/duplex.rs index 3840e55bb424d..4ab2ac97cc157 100644 --- a/src/libsync/comm/duplex.rs +++ b/src/libsync/comm/duplex.rs @@ -64,7 +64,7 @@ mod test { let (left, right) = duplex(); left.send("abc".to_string()); - right.send(123); + right.send(123i); assert!(left.recv() == 123); assert!(right.recv() == "abc".to_string()); diff --git a/src/libsync/comm/mod.rs b/src/libsync/comm/mod.rs index 3e8f4eef3705c..665f94d80b237 100644 --- a/src/libsync/comm/mod.rs +++ b/src/libsync/comm/mod.rs @@ -1543,7 +1543,7 @@ mod test { let (tx, rx) = channel(); let (cdone, pdone) = channel(); let t = Thread::start(proc() { - let mut hits = 0; + let mut hits = 0u; while hits < 10 { match rx.try_recv() { Ok(()) => { hits += 1; } @@ -1993,7 +1993,7 @@ mod sync_tests { let (tx, rx) = sync_channel::<()>(0); let (cdone, pdone) = channel(); let t = Thread::start(proc() { - let mut hits = 0; + let mut hits = 0u; while hits < 10 { match rx.try_recv() { Ok(()) => { hits += 1; } diff --git a/src/libsync/deque.rs b/src/libsync/deque.rs index cdd030ac34adc..8d2192aeb537e 100644 --- a/src/libsync/deque.rs +++ b/src/libsync/deque.rs @@ -30,15 +30,15 @@ //! let (mut worker, mut stealer) = pool.deque(); //! //! // Only the worker may push/pop -//! worker.push(1); +//! worker.push(1i); //! worker.pop(); //! //! // Stealers take data from the other end of the deque -//! worker.push(1); +//! worker.push(1i); //! stealer.steal(); //! //! // Stealers can be cloned to have many stealers stealing in parallel -//! worker.push(1); +//! worker.push(1i); //! let mut stealer2 = stealer.clone(); //! stealer2.steal(); diff --git a/src/libsync/lock.rs b/src/libsync/lock.rs index dff9fee2b772d..1d119bafea199 100644 --- a/src/libsync/lock.rs +++ b/src/libsync/lock.rs @@ -158,7 +158,7 @@ impl<'a> Condvar<'a> { /// ``` /// use sync::{Mutex, Arc}; /// -/// let mutex = Arc::new(Mutex::new(1)); +/// let mutex = Arc::new(Mutex::new(1i)); /// let mutex2 = mutex.clone(); /// /// spawn(proc() { @@ -487,7 +487,7 @@ mod tests { #[test] #[should_fail] fn test_arc_condvar_poison() { - let arc = Arc::new(Mutex::new(1)); + let arc = Arc::new(Mutex::new(1i)); let arc2 = arc.clone(); let (tx, rx) = channel(); diff --git a/src/libsync/mpsc_queue.rs b/src/libsync/mpsc_queue.rs index 4bb0acf580c57..ecd37e6888055 100644 --- a/src/libsync/mpsc_queue.rs +++ b/src/libsync/mpsc_queue.rs @@ -167,8 +167,8 @@ mod tests { #[test] fn test_full() { let q = Queue::new(); - q.push(box 1); - q.push(box 2); + q.push(box 1i); + q.push(box 2i); } #[test] diff --git a/src/libsync/spsc_queue.rs b/src/libsync/spsc_queue.rs index a4da1fd233547..2834d404c1879 100644 --- a/src/libsync/spsc_queue.rs +++ b/src/libsync/spsc_queue.rs @@ -252,8 +252,8 @@ mod test { #[test] fn drop_full() { let q = Queue::new(0); - q.push(box 1); - q.push(box 2); + q.push(box 1i); + q.push(box 2i); } #[test] @@ -284,7 +284,7 @@ mod test { for _ in range(0u, 100000) { loop { match b.pop() { - Some(1) => break, + Some(1i) => break, Some(_) => fail!(), None => {} } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 6719f25abb942..a9cf4fbd9f0f1 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -998,7 +998,7 @@ impl<'a> State<'a> { pub fn print_outer_attributes(&mut self, attrs: &[ast::Attribute]) -> IoResult<()> { - let mut count = 0; + let mut count = 0u; for attr in attrs.iter() { match attr.node.style { ast::AttrOuter => { @@ -1016,7 +1016,7 @@ impl<'a> State<'a> { pub fn print_inner_attributes(&mut self, attrs: &[ast::Attribute]) -> IoResult<()> { - let mut count = 0; + let mut count = 0u; for attr in attrs.iter() { match attr.node.style { ast::AttrInner => { diff --git a/src/libsyntax/util/small_vector.rs b/src/libsyntax/util/small_vector.rs index d5cc2c7f304c7..43367611ab2b9 100644 --- a/src/libsyntax/util/small_vector.rs +++ b/src/libsyntax/util/small_vector.rs @@ -166,8 +166,8 @@ mod test { let v: SmallVector = SmallVector::zero(); assert_eq!(0, v.len()); - assert_eq!(1, SmallVector::one(1).len()); - assert_eq!(5, SmallVector::many(vec!(1, 2, 3, 4, 5)).len()); + assert_eq!(1, SmallVector::one(1i).len()); + assert_eq!(5, SmallVector::many(vec!(1i, 2, 3, 4, 5)).len()); } #[test] @@ -215,7 +215,7 @@ mod test { #[test] #[should_fail] fn test_expect_one_many() { - SmallVector::many(vec!(1, 2)).expect_one(""); + SmallVector::many(vec!(1i, 2)).expect_one(""); } #[test] diff --git a/src/liburl/lib.rs b/src/liburl/lib.rs index 566602b409104..577a1e8ea9e54 100644 --- a/src/liburl/lib.rs +++ b/src/liburl/lib.rs @@ -546,7 +546,7 @@ fn get_authority(rawurl: &str) -> let mut host = "".to_string(); let mut port = None; - let mut colon_count = 0; + let mut colon_count = 0u; let mut pos = 0; let mut begin = 2; let mut end = len; diff --git a/src/test/auxiliary/issue-8044.rs b/src/test/auxiliary/issue-8044.rs index c0c884f5480c0..d8f96e5abd443 100644 --- a/src/test/auxiliary/issue-8044.rs +++ b/src/test/auxiliary/issue-8044.rs @@ -23,5 +23,5 @@ pub fn leaf(value: V) -> TreeItem { } fn main() { - BTree:: { node: leaf(1) }; + BTree:: { node: leaf(1i) }; } diff --git a/src/test/auxiliary/issue-9906.rs b/src/test/auxiliary/issue-9906.rs index 1e746bf39db61..c0cb501735da3 100644 --- a/src/test/auxiliary/issue-9906.rs +++ b/src/test/auxiliary/issue-9906.rs @@ -22,6 +22,6 @@ mod other { } pub fn foo(){ - 1+1; + 1i+1; } } diff --git a/src/test/compile-fail/borrowck-anon-fields-tuple.rs b/src/test/compile-fail/borrowck-anon-fields-tuple.rs index ebaed01756fb2..9a452ed18f67e 100644 --- a/src/test/compile-fail/borrowck-anon-fields-tuple.rs +++ b/src/test/compile-fail/borrowck-anon-fields-tuple.rs @@ -12,7 +12,7 @@ // anonymous fields of a tuple vs the same anonymous field. fn distinct_variant() { - let mut y = (1, 2); + let mut y = (1i, 2i); let a = match y { (ref mut a, _) => a @@ -27,7 +27,7 @@ fn distinct_variant() { } fn same_variant() { - let mut y = (1, 2); + let mut y = (1i, 2i); let a = match y { (ref mut a, _) => a diff --git a/src/test/compile-fail/borrowck-array-double-move.rs b/src/test/compile-fail/borrowck-array-double-move.rs index c7fb646f585b9..c872d0dc4b9c4 100644 --- a/src/test/compile-fail/borrowck-array-double-move.rs +++ b/src/test/compile-fail/borrowck-array-double-move.rs @@ -9,9 +9,9 @@ // except according to those terms. fn f() { - let mut a = [box 0, box 1]; + let mut a = [box 0i, box 1i]; drop(a[0]); - a[1] = box 2; + a[1] = box 2i; drop(a[0]); //~ ERROR use of moved value: `a[..]` } diff --git a/src/test/compile-fail/borrowck-break-uninit-2.rs b/src/test/compile-fail/borrowck-break-uninit-2.rs index de18759e30a4c..0b10ccfdca193 100644 --- a/src/test/compile-fail/borrowck-break-uninit-2.rs +++ b/src/test/compile-fail/borrowck-break-uninit-2.rs @@ -11,14 +11,14 @@ fn foo() -> int { let x: int; - while 1 != 2 { + while 1i != 2 { break; x = 0; } println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` - return 17; + return 17i; } fn main() { println!("{}", foo()); } diff --git a/src/test/compile-fail/borrowck-closures-mut-and-imm.rs b/src/test/compile-fail/borrowck-closures-mut-and-imm.rs index ce8b17ea40bc6..886026e45d90f 100644 --- a/src/test/compile-fail/borrowck-closures-mut-and-imm.rs +++ b/src/test/compile-fail/borrowck-closures-mut-and-imm.rs @@ -21,37 +21,37 @@ fn set(x: &mut int) { } fn a() { - let mut x = 3; + let mut x = 3i; let c1 = || x = 4; let c2 = || x * 5; //~ ERROR cannot borrow `x` } fn b() { - let mut x = 3; + let mut x = 3i; let c1 = || set(&mut x); let c2 = || get(&x); //~ ERROR cannot borrow `x` } fn c() { - let mut x = 3; + let mut x = 3i; let c1 = || set(&mut x); let c2 = || x * 5; //~ ERROR cannot borrow `x` } fn d() { - let mut x = 3; + let mut x = 3i; let c2 = || x * 5; x = 5; //~ ERROR cannot assign } fn e() { - let mut x = 3; + let mut x = 3i; let c1 = || get(&x); x = 5; //~ ERROR cannot assign } fn f() { - let mut x = box 3; + let mut x = box 3i; let c1 = || get(&*x); *x = 5; //~ ERROR cannot assign } diff --git a/src/test/compile-fail/borrowck-closures-two-mut.rs b/src/test/compile-fail/borrowck-closures-two-mut.rs index e1967d4e6df94..6d382854d49f2 100644 --- a/src/test/compile-fail/borrowck-closures-two-mut.rs +++ b/src/test/compile-fail/borrowck-closures-two-mut.rs @@ -14,7 +14,7 @@ fn a() { - let mut x = 3; + let mut x = 3i; let c1 = || x = 4; let c2 = || x = 5; //~ ERROR cannot borrow `x` as mutable more than once } @@ -24,19 +24,19 @@ fn set(x: &mut int) { } fn b() { - let mut x = 3; + let mut x = 3i; let c1 = || set(&mut x); let c2 = || set(&mut x); //~ ERROR cannot borrow `x` as mutable more than once } fn c() { - let mut x = 3; + let mut x = 3i; let c1 = || x = 5; let c2 = || set(&mut x); //~ ERROR cannot borrow `x` as mutable more than once } fn d() { - let mut x = 3; + let mut x = 3i; let c1 = || x = 5; let c2 = || { let _y = || set(&mut x); }; // (nested closure) //~^ ERROR cannot borrow `x` as mutable more than once diff --git a/src/test/compile-fail/borrowck-if-no-else.rs b/src/test/compile-fail/borrowck-if-no-else.rs index a35b36fd78ca8..854d42219ea25 100644 --- a/src/test/compile-fail/borrowck-if-no-else.rs +++ b/src/test/compile-fail/borrowck-if-no-else.rs @@ -11,6 +11,6 @@ fn foo(x: int) { println!("{}", x); } fn main() { - let x: int; if 1 > 2 { x = 10; } + let x: int; if 1i > 2 { x = 10; } foo(x); //~ ERROR use of possibly uninitialized variable: `x` } diff --git a/src/test/compile-fail/borrowck-if-with-else.rs b/src/test/compile-fail/borrowck-if-with-else.rs index 6e2dae0af7db0..74888cca2d4bd 100644 --- a/src/test/compile-fail/borrowck-if-with-else.rs +++ b/src/test/compile-fail/borrowck-if-with-else.rs @@ -14,7 +14,7 @@ fn foo(x: int) { println!("{:?}", x); } fn main() { let x: int; - if 1 > 2 { + if 1i > 2 { println!("whoops"); } else { x = 10; diff --git a/src/test/compile-fail/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs b/src/test/compile-fail/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs index 8af10231921aa..d127e9345cde1 100644 --- a/src/test/compile-fail/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs +++ b/src/test/compile-fail/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs @@ -9,7 +9,7 @@ // except according to those terms. fn main() { - let mut _a = 3; + let mut _a = 3i; let _b = &mut _a; { let _c = &*_b; diff --git a/src/test/compile-fail/borrowck-issue-2657-1.rs b/src/test/compile-fail/borrowck-issue-2657-1.rs index 9313473d6c916..9d28b2a436f4a 100644 --- a/src/test/compile-fail/borrowck-issue-2657-1.rs +++ b/src/test/compile-fail/borrowck-issue-2657-1.rs @@ -9,11 +9,11 @@ // except according to those terms. fn main() { -let x = Some(box 1); -match x { - Some(ref _y) => { - let _a = x; //~ ERROR cannot move - } - _ => {} -} + let x = Some(box 1i); + match x { + Some(ref _y) => { + let _a = x; //~ ERROR cannot move + } + _ => {} + } } diff --git a/src/test/compile-fail/borrowck-issue-2657-2.rs b/src/test/compile-fail/borrowck-issue-2657-2.rs index 39c3ae8fdfde0..973cf3bf8c889 100644 --- a/src/test/compile-fail/borrowck-issue-2657-2.rs +++ b/src/test/compile-fail/borrowck-issue-2657-2.rs @@ -9,11 +9,11 @@ // except according to those terms. fn main() { -let x = Some(box 1); -match x { - Some(ref y) => { - let _b = *y; //~ ERROR cannot move out - } - _ => {} -} + let x = Some(box 1i); + match x { + Some(ref y) => { + let _b = *y; //~ ERROR cannot move out + } + _ => {} + } } diff --git a/src/test/compile-fail/borrowck-lend-flow-match.rs b/src/test/compile-fail/borrowck-lend-flow-match.rs index 7a494b5959a8a..c6020df2bc2ea 100644 --- a/src/test/compile-fail/borrowck-lend-flow-match.rs +++ b/src/test/compile-fail/borrowck-lend-flow-match.rs @@ -35,20 +35,20 @@ fn guard() { // Here the guard performs a borrow. This borrow "infects" all // subsequent arms (but not the prior ones). - let mut a = box 3; - let mut b = box 4; + let mut a = box 3u; + let mut b = box 4u; let mut w = &*a; - match 22 { + match 22i { _ if cond() => { - b = box 5; + b = box 5u; } _ if link(&*b, &mut w) => { - b = box 6; //~ ERROR cannot assign + b = box 6u; //~ ERROR cannot assign } _ => { - b = box 7; //~ ERROR cannot assign + b = box 7u; //~ ERROR cannot assign } } diff --git a/src/test/compile-fail/borrowck-let-suggestion.rs b/src/test/compile-fail/borrowck-let-suggestion.rs index a03087f9b2dad..385111170b126 100644 --- a/src/test/compile-fail/borrowck-let-suggestion.rs +++ b/src/test/compile-fail/borrowck-let-suggestion.rs @@ -9,9 +9,9 @@ // except according to those terms. fn f() { - let x = [1].iter(); //~ ERROR borrowed value does not live long enough - //~^^ NOTE reference must be valid for the block - //~^^ NOTE consider using a `let` binding to increase its lifetime + let x = [1i].iter(); //~ ERROR borrowed value does not live long enough + //~^^ NOTE reference must be valid for the block + //~^^ NOTE consider using a `let` binding to increase its lifetime } fn main() { diff --git a/src/test/compile-fail/borrowck-managed-pointer-deref-scope.rs b/src/test/compile-fail/borrowck-managed-pointer-deref-scope.rs index dba2c7dca766a..30430e00ef342 100644 --- a/src/test/compile-fail/borrowck-managed-pointer-deref-scope.rs +++ b/src/test/compile-fail/borrowck-managed-pointer-deref-scope.rs @@ -24,10 +24,10 @@ fn foo<'a>(x: &'a Gc) -> &'a int { } fn bar() { - let a = 3; + let a = 3i; let mut y = &a; if true { - let x = box(GC) 3; + let x = box(GC) 3i; y = &*x; //~ ERROR `*x` does not live long enough } } diff --git a/src/test/compile-fail/borrowck-match-binding-is-assignment.rs b/src/test/compile-fail/borrowck-match-binding-is-assignment.rs index 6b5dd570e34e2..f599f237ba672 100644 --- a/src/test/compile-fail/borrowck-match-binding-is-assignment.rs +++ b/src/test/compile-fail/borrowck-match-binding-is-assignment.rs @@ -43,7 +43,7 @@ pub fn main() { } } - match [1,2,3] { + match [1i,2,3] { [x,_,_] => { x += 1; //~ ERROR re-assignment of immutable variable `x` } diff --git a/src/test/compile-fail/borrowck-move-from-subpath-of-borrowed-path.rs b/src/test/compile-fail/borrowck-move-from-subpath-of-borrowed-path.rs index 35106487f3475..63409f5afb04c 100644 --- a/src/test/compile-fail/borrowck-move-from-subpath-of-borrowed-path.rs +++ b/src/test/compile-fail/borrowck-move-from-subpath-of-borrowed-path.rs @@ -12,7 +12,7 @@ // borrowed path. fn main() { - let a = box box 2; + let a = box box 2i; let b = &a; let z = *a; //~ ERROR: cannot move out of `*a` because it is borrowed diff --git a/src/test/compile-fail/borrowck-move-out-of-overloaded-auto-deref.rs b/src/test/compile-fail/borrowck-move-out-of-overloaded-auto-deref.rs index 1a96e5ef4b0cc..7962617916346 100644 --- a/src/test/compile-fail/borrowck-move-out-of-overloaded-auto-deref.rs +++ b/src/test/compile-fail/borrowck-move-out-of-overloaded-auto-deref.rs @@ -11,6 +11,6 @@ use std::rc::Rc; pub fn main() { - let _x = Rc::new(vec!(1, 2)).move_iter(); + let _x = Rc::new(vec!(1i, 2)).move_iter(); //~^ ERROR cannot move out of dereference of `&`-pointer } diff --git a/src/test/compile-fail/borrowck-multiple-captures.rs b/src/test/compile-fail/borrowck-multiple-captures.rs index e12d2b9147978..6faa634ad00b8 100644 --- a/src/test/compile-fail/borrowck-multiple-captures.rs +++ b/src/test/compile-fail/borrowck-multiple-captures.rs @@ -13,9 +13,9 @@ use std::task; fn borrow(_: &T) { } fn different_vars_after_borrows() { - let x1 = box 1; + let x1 = box 1i; let p1 = &x1; - let x2 = box 2; + let x2 = box 2i; let p2 = &x2; task::spawn(proc() { drop(x1); //~ ERROR cannot move `x1` into closure because it is borrowed @@ -26,9 +26,9 @@ fn different_vars_after_borrows() { } fn different_vars_after_moves() { - let x1 = box 1; + let x1 = box 1i; drop(x1); - let x2 = box 2; + let x2 = box 2i; drop(x2); task::spawn(proc() { drop(x1); //~ ERROR capture of moved value: `x1` @@ -37,7 +37,7 @@ fn different_vars_after_moves() { } fn same_var_after_borrow() { - let x = box 1; + let x = box 1i; let p = &x; task::spawn(proc() { drop(x); //~ ERROR cannot move `x` into closure because it is borrowed @@ -47,7 +47,7 @@ fn same_var_after_borrow() { } fn same_var_after_move() { - let x = box 1; + let x = box 1i; drop(x); task::spawn(proc() { drop(x); //~ ERROR capture of moved value: `x` diff --git a/src/test/compile-fail/borrowck-uniq-via-lend.rs b/src/test/compile-fail/borrowck-uniq-via-lend.rs index fb03ad61f3d1e..5a129956487c9 100644 --- a/src/test/compile-fail/borrowck-uniq-via-lend.rs +++ b/src/test/compile-fail/borrowck-uniq-via-lend.rs @@ -12,7 +12,7 @@ fn borrow(_v: &int) {} fn local() { - let mut v = box 3; + let mut v = box 3i; borrow(v); } @@ -31,27 +31,27 @@ fn local_recs() { } fn aliased_imm() { - let mut v = box 3; + let mut v = box 3i; let _w = &v; borrow(v); } fn aliased_mut() { - let mut v = box 3; + let mut v = box 3i; let _w = &mut v; borrow(v); //~ ERROR cannot borrow `*v` } fn aliased_other() { - let mut v = box 3; - let mut w = box 4; + let mut v = box 3i; + let mut w = box 4i; let _x = &mut w; borrow(v); } fn aliased_other_reassign() { - let mut v = box 3; - let mut w = box 4; + let mut v = box 3i; + let mut w = box 4i; let mut _x = &mut w; _x = &mut v; borrow(v); //~ ERROR cannot borrow `*v` diff --git a/src/test/compile-fail/borrowck-vec-pattern-move-tail.rs b/src/test/compile-fail/borrowck-vec-pattern-move-tail.rs index cca8ed93388bc..7b092d16eec69 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-move-tail.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-move-tail.rs @@ -9,7 +9,7 @@ // except according to those terms. fn main() { - let mut a = [1, 2, 3, 4]; + let mut a = [1i, 2, 3, 4]; let t = match a { [1, 2, ..tail] => tail, _ => unreachable!() diff --git a/src/test/compile-fail/borrowck-vec-pattern-nesting.rs b/src/test/compile-fail/borrowck-vec-pattern-nesting.rs index f41f74b166fd2..4a56f9821065b 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-nesting.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-nesting.rs @@ -10,7 +10,7 @@ fn a() { - let mut vec = [box 1, box 2, box 3]; + let mut vec = [box 1i, box 2, box 3]; match vec { [box ref _a, _, _] => { vec[0] = box 4; //~ ERROR cannot assign @@ -19,7 +19,7 @@ fn a() { } fn b() { - let mut vec = vec!(box 1, box 2, box 3); + let mut vec = vec!(box 1i, box 2, box 3); let vec: &mut [Box] = vec.as_mut_slice(); match vec { [.._b] => { @@ -29,7 +29,7 @@ fn b() { } fn c() { - let mut vec = vec!(box 1, box 2, box 3); + let mut vec = vec!(box 1i, box 2, box 3); let vec: &mut [Box] = vec.as_mut_slice(); match vec { [_a, //~ ERROR cannot move out @@ -47,7 +47,7 @@ fn c() { } fn d() { - let mut vec = vec!(box 1, box 2, box 3); + let mut vec = vec!(box 1i, box 2, box 3); let vec: &mut [Box] = vec.as_mut_slice(); match vec { [.._a, //~ ERROR cannot move out @@ -58,7 +58,7 @@ fn d() { } fn e() { - let mut vec = vec!(box 1, box 2, box 3); + let mut vec = vec!(box 1i, box 2, box 3); let vec: &mut [Box] = vec.as_mut_slice(); match vec { [_a, _b, _c] => {} //~ ERROR cannot move out diff --git a/src/test/compile-fail/borrowck-while.rs b/src/test/compile-fail/borrowck-while.rs index b904fd53d7279..b5703e56642ad 100644 --- a/src/test/compile-fail/borrowck-while.rs +++ b/src/test/compile-fail/borrowck-while.rs @@ -10,7 +10,7 @@ fn f() -> int { let mut x: int; - while 1 == 1 { x = 10; } + while 1i == 1 { x = 10; } return x; //~ ERROR use of possibly uninitialized variable: `x` } diff --git a/src/test/compile-fail/builtin-superkinds-self-type.rs b/src/test/compile-fail/builtin-superkinds-self-type.rs index 0d5a71559e867..bea025df6fc85 100644 --- a/src/test/compile-fail/builtin-superkinds-self-type.rs +++ b/src/test/compile-fail/builtin-superkinds-self-type.rs @@ -21,6 +21,6 @@ impl Foo for T { } fn main() { let (tx, rx) = channel(); - 1193182.foo(tx); - assert!(rx.recv() == 1193182); + 1193182i.foo(tx); + assert!(rx.recv() == 1193182i); } diff --git a/src/test/compile-fail/const-block-non-item-statement.rs b/src/test/compile-fail/const-block-non-item-statement.rs index ace917c704acb..d8f771cfb5a73 100644 --- a/src/test/compile-fail/const-block-non-item-statement.rs +++ b/src/test/compile-fail/const-block-non-item-statement.rs @@ -10,7 +10,7 @@ #![feature(macro_rules)] -static A: uint = { 1; 2 }; +static A: uint = { 1u; 2 }; //~^ ERROR: blocks in constants are limited to items and tail expressions static B: uint = { { } 2 }; @@ -21,7 +21,7 @@ macro_rules! foo { } static C: uint = { foo!() 2 }; -static D: uint = { let x = 4; 2 }; +static D: uint = { let x = 4u; 2 }; //~^ ERROR: blocks in constants are limited to items and tail expressions pub fn main() { diff --git a/src/test/compile-fail/for-loop-refutable-pattern-error-message.rs b/src/test/compile-fail/for-loop-refutable-pattern-error-message.rs index 8b00b61490993..8de613ac03d0f 100644 --- a/src/test/compile-fail/for-loop-refutable-pattern-error-message.rs +++ b/src/test/compile-fail/for-loop-refutable-pattern-error-message.rs @@ -11,6 +11,6 @@ fn main() { for - &1 //~ ERROR refutable pattern in `for` loop binding - in [1].iter() {} + &1i //~ ERROR refutable pattern in `for` loop binding + in [1i].iter() {} } diff --git a/src/test/compile-fail/integer-literal-suffix-inference-2.rs b/src/test/compile-fail/integer-literal-suffix-inference-2.rs new file mode 100644 index 0000000000000..7c862d04d206d --- /dev/null +++ b/src/test/compile-fail/integer-literal-suffix-inference-2.rs @@ -0,0 +1,17 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo(_: *const ()) {} + +fn main() { + let a = 3; //~ ERROR cannot determine a type for this local variable + foo(&a as *const _ as *const ()); +} + diff --git a/src/test/compile-fail/integer-literal-suffix-inference-3.rs b/src/test/compile-fail/integer-literal-suffix-inference-3.rs new file mode 100644 index 0000000000000..dc3db98566030 --- /dev/null +++ b/src/test/compile-fail/integer-literal-suffix-inference-3.rs @@ -0,0 +1,15 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + println!("{}", std::mem::size_of_val(&1)); + //~^ ERROR cannot determine a type for this expression +} + diff --git a/src/test/compile-fail/issue-10398.rs b/src/test/compile-fail/issue-10398.rs index 97642377ba8f4..9141ab669bbc2 100644 --- a/src/test/compile-fail/issue-10398.rs +++ b/src/test/compile-fail/issue-10398.rs @@ -9,7 +9,7 @@ // except according to those terms. fn main() { - let x = box 1; + let x = box 1i; let f: proc() = proc() { let _a = x; drop(x); diff --git a/src/test/compile-fail/issue-11493.rs b/src/test/compile-fail/issue-11493.rs index 333ff7118d45b..7856a5dcf7f2e 100644 --- a/src/test/compile-fail/issue-11493.rs +++ b/src/test/compile-fail/issue-11493.rs @@ -11,6 +11,6 @@ // This file must never have a trailing newline fn main() { - let x = Some(3); - let y = x.as_ref().unwrap_or(&5); //~ ERROR: borrowed value does not live long enough + let x = Some(3i); + let y = x.as_ref().unwrap_or(&5i); //~ ERROR: borrowed value does not live long enough } diff --git a/src/test/compile-fail/issue-11873.rs b/src/test/compile-fail/issue-11873.rs index 0ca326c1e0d9f..e1acab4008a9b 100644 --- a/src/test/compile-fail/issue-11873.rs +++ b/src/test/compile-fail/issue-11873.rs @@ -9,8 +9,8 @@ // except according to those terms. fn main() { - let mut v = vec!(1); - let f = || v.push(2); + let mut v = vec!(1i); + let f = || v.push(2i); let _w = v; //~ ERROR: cannot move out of `v` f(); diff --git a/src/test/compile-fail/issue-11925.rs b/src/test/compile-fail/issue-11925.rs index a8d2c7509ce3f..5d62c25ea171b 100644 --- a/src/test/compile-fail/issue-11925.rs +++ b/src/test/compile-fail/issue-11925.rs @@ -10,7 +10,7 @@ fn main() { let r = { - let x = box 42; + let x = box 42i; let f = proc() &x; //~ ERROR: `x` does not live long enough f() }; diff --git a/src/test/compile-fail/issue-12041.rs b/src/test/compile-fail/issue-12041.rs index 9ad593673120d..f824a06aed1b3 100644 --- a/src/test/compile-fail/issue-12041.rs +++ b/src/test/compile-fail/issue-12041.rs @@ -14,7 +14,7 @@ fn main() { loop { let tx = tx; //~^ ERROR: use of moved value: `tx` - tx.send(1); + tx.send(1i); } }); } diff --git a/src/test/compile-fail/issue-1962.rs b/src/test/compile-fail/issue-1962.rs index db3e9c23b7621..c59ee328eff40 100644 --- a/src/test/compile-fail/issue-1962.rs +++ b/src/test/compile-fail/issue-1962.rs @@ -10,9 +10,9 @@ // compile-flags: -D while-true fn main() { - let mut i = 0; + let mut i = 0i; while true { //~ ERROR denote infinite loops with loop - i += 1; - if i == 5 { break; } + i += 1i; + if i == 5i { break; } } } diff --git a/src/test/compile-fail/issue-3707.rs b/src/test/compile-fail/issue-3707.rs index 4e128b63e9257..2445638d62e60 100644 --- a/src/test/compile-fail/issue-3707.rs +++ b/src/test/compile-fail/issue-3707.rs @@ -14,7 +14,7 @@ struct Obj { impl Obj { pub fn boom() -> bool { - return 1+1 == 2 + return 1i+1 == 2 } pub fn chirp(&self) { self.boom(); //~ ERROR `&Obj` does not implement any method in scope named `boom` @@ -24,5 +24,5 @@ impl Obj { fn main() { let o = Obj { member: 0 }; o.chirp(); - 1 + 1; + 1i + 1; } diff --git a/src/test/compile-fail/lint-dead-code-1.rs b/src/test/compile-fail/lint-dead-code-1.rs index f8e59ad13ad7a..8417f7810ead2 100644 --- a/src/test/compile-fail/lint-dead-code-1.rs +++ b/src/test/compile-fail/lint-dead-code-1.rs @@ -35,7 +35,7 @@ static priv_static: int = 0; //~ ERROR: code is never used static used_static: int = 0; pub static used_static2: int = used_static; static USED_STATIC: int = 0; -static STATIC_USED_IN_ENUM_DISCRIMINANT: uint = 10; +static STATIC_USED_IN_ENUM_DISCRIMINANT: int = 10; pub type typ = *const UsedStruct4; pub struct PubStruct; @@ -77,7 +77,7 @@ pub fn pub_fn() { let e = foo3; SemiUsedStruct::la_la_la(); - let i = 1; + let i = 1i; match i { USED_STATIC => (), _ => () diff --git a/src/test/compile-fail/lint-heap-memory.rs b/src/test/compile-fail/lint-heap-memory.rs index 2ec9efe9498ce..8f495645dc7ea 100644 --- a/src/test/compile-fail/lint-heap-memory.rs +++ b/src/test/compile-fail/lint-heap-memory.rs @@ -21,11 +21,11 @@ struct Foo { struct Bar { x: Box } //~ ERROR type uses owned fn main() { - let _x : Bar = Bar {x : box 10}; //~ ERROR type uses owned + let _x : Bar = Bar {x : box 10i}; //~ ERROR type uses owned - box(GC) 2; //~ ERROR type uses managed + box(GC) 2i; //~ ERROR type uses managed - box 2; //~ ERROR type uses owned + box 2i; //~ ERROR type uses owned fn g(_: Box) {} //~ ERROR type uses owned proc() {}; //~ ERROR type uses owned } diff --git a/src/test/compile-fail/lint-unnecessary-parens.rs b/src/test/compile-fail/lint-unnecessary-parens.rs index 4d9383aeda2a1..d51d5b4af87a9 100644 --- a/src/test/compile-fail/lint-unnecessary-parens.rs +++ b/src/test/compile-fail/lint-unnecessary-parens.rs @@ -17,7 +17,7 @@ impl X { } fn foo() -> int { - return (1); //~ ERROR unnecessary parentheses around `return` value + return (1i); //~ ERROR unnecessary parentheses around `return` value } fn bar() -> X { return (X { y: true }); //~ ERROR unnecessary parentheses around `return` value @@ -45,7 +45,7 @@ fn main() { _ => {} } - let mut _a = (0); //~ ERROR unnecessary parentheses around assigned value - _a = (0); //~ ERROR unnecessary parentheses around assigned value - _a += (1); //~ ERROR unnecessary parentheses around assigned value + let mut _a = (0i); //~ ERROR unnecessary parentheses around assigned value + _a = (0i); //~ ERROR unnecessary parentheses around assigned value + _a += (1i); //~ ERROR unnecessary parentheses around assigned value } diff --git a/src/test/compile-fail/lint-unused-imports.rs b/src/test/compile-fail/lint-unused-imports.rs index 4334d2f63ea59..f03e748e4176d 100644 --- a/src/test/compile-fail/lint-unused-imports.rs +++ b/src/test/compile-fail/lint-unused-imports.rs @@ -55,7 +55,7 @@ mod bar { pub mod c { use foo::Point; use foo::Square; //~ ERROR unused import - pub fn cc(p: Point) -> int { return 2 * (p.x + p.y); } + pub fn cc(p: Point) -> int { return 2i * (p.x + p.y); } } #[allow(unused_imports)] @@ -66,8 +66,8 @@ mod bar { fn main() { cal(foo::Point{x:3, y:9}); - let mut a = 3; - let mut b = 4; + let mut a = 3i; + let mut b = 4i; swap(&mut a, &mut b); test::C.b(); let _a = foo(); diff --git a/src/test/compile-fail/lint-unused-mut-variables.rs b/src/test/compile-fail/lint-unused-mut-variables.rs index d5f34669a25e2..c5281bf678185 100644 --- a/src/test/compile-fail/lint-unused-mut-variables.rs +++ b/src/test/compile-fail/lint-unused-mut-variables.rs @@ -18,16 +18,16 @@ fn main() { // negative cases - let mut a = 3; //~ ERROR: variable does not need to be mutable - let mut a = 2; //~ ERROR: variable does not need to be mutable - let mut b = 3; //~ ERROR: variable does not need to be mutable - let mut a = vec!(3); //~ ERROR: variable does not need to be mutable - let (mut a, b) = (1, 2); //~ ERROR: variable does not need to be mutable + let mut a = 3i; //~ ERROR: variable does not need to be mutable + let mut a = 2i; //~ ERROR: variable does not need to be mutable + let mut b = 3i; //~ ERROR: variable does not need to be mutable + let mut a = vec!(3i); //~ ERROR: variable does not need to be mutable + let (mut a, b) = (1i, 2i); //~ ERROR: variable does not need to be mutable - match 30 { + match 30i { mut x => {} //~ ERROR: variable does not need to be mutable } - match (30, 2) { + match (30i, 2i) { (mut x, 1) | //~ ERROR: variable does not need to be mutable (mut x, 2) | (mut x, 3) => { @@ -35,28 +35,28 @@ fn main() { _ => {} } - let x = |mut y: int| 10; //~ ERROR: variable does not need to be mutable + let x = |mut y: int| 10i; //~ ERROR: variable does not need to be mutable fn what(mut foo: int) {} //~ ERROR: variable does not need to be mutable // positive cases - let mut a = 2; - a = 3; + let mut a = 2i; + a = 3i; let mut a = Vec::new(); - a.push(3); + a.push(3i); let mut a = Vec::new(); callback(|| { - a.push(3); + a.push(3i); }); - let (mut a, b) = (1, 2); + let (mut a, b) = (1i, 2i); a = 34; - match 30 { + match 30i { mut x => { - x = 21; + x = 21i; } } - match (30, 2) { + match (30i, 2i) { (mut x, 1) | (mut x, 2) | (mut x, 3) => { @@ -65,12 +65,12 @@ fn main() { _ => {} } - let x = |mut y: int| y = 32; - fn nothing(mut foo: int) { foo = 37; } + let x = |mut y: int| y = 32i; + fn nothing(mut foo: int) { foo = 37i; } // leading underscore should avoid the warning, just like the // unused variable lint. - let mut _allowed = 1; + let mut _allowed = 1i; } fn callback(f: ||) {} @@ -78,6 +78,6 @@ fn callback(f: ||) {} // make sure the lint attribute can be turned off #[allow(unused_mut)] fn foo(mut a: int) { - let mut a = 3; - let mut b = vec!(2); + let mut a = 3i; + let mut b = vec!(2i); } diff --git a/src/test/compile-fail/liveness-unused.rs b/src/test/compile-fail/liveness-unused.rs index ee44872d12201..68dbacaae5cf4 100644 --- a/src/test/compile-fail/liveness-unused.rs +++ b/src/test/compile-fail/liveness-unused.rs @@ -29,40 +29,40 @@ fn f1d() { } fn f2() { - let x = 3; + let x = 3i; //~^ ERROR unused variable: `x` } fn f3() { - let mut x = 3; + let mut x = 3i; //~^ ERROR variable `x` is assigned to, but never used - x += 4; + x += 4i; //~^ ERROR value assigned to `x` is never read } fn f3b() { - let mut z = 3; + let mut z = 3i; //~^ ERROR variable `z` is assigned to, but never used loop { - z += 4; + z += 4i; } } #[allow(unused_variable)] fn f3c() { - let mut z = 3; - loop { z += 4; } + let mut z = 3i; + loop { z += 4i; } } #[allow(unused_variable)] #[allow(dead_assignment)] fn f3d() { - let mut x = 3; - x += 4; + let mut x = 3i; + x += 4i; } fn f4() { - match Some(3) { + match Some(3i) { Some(i) => { //~^ ERROR unused variable: `i` } @@ -75,7 +75,7 @@ enum tri { } fn f4b() -> int { - match a(3) { + match a(3i) { a(i) | b(i) | c(i) => { i } diff --git a/src/test/compile-fail/match-ill-type2.rs b/src/test/compile-fail/match-ill-type2.rs index d8d665e2af6b0..17f02abc8ec89 100644 --- a/src/test/compile-fail/match-ill-type2.rs +++ b/src/test/compile-fail/match-ill-type2.rs @@ -9,9 +9,9 @@ // except according to those terms. fn main() { - match 1 { - 1 => 1, //~ ERROR mismatched types between arms - 2u => 1, - _ => 2, + match 1i { + 1i => 1i, + 2u => 1i, //~ ERROR mismatched types + _ => 2i, }; } diff --git a/src/test/compile-fail/match-non-exhaustive.rs b/src/test/compile-fail/match-non-exhaustive.rs index a24d2ed4b7fba..20adbeebdf1d7 100644 --- a/src/test/compile-fail/match-non-exhaustive.rs +++ b/src/test/compile-fail/match-non-exhaustive.rs @@ -9,6 +9,6 @@ // except according to those terms. fn main() { - match 0 { 1 => () } //~ ERROR non-exhaustive patterns - match 0 { 0 if false => () } //~ ERROR non-exhaustive patterns + match 0i { 1i => () } //~ ERROR non-exhaustive patterns + match 0i { 0i if false => () } //~ ERROR non-exhaustive patterns } diff --git a/src/test/compile-fail/match-range-fail-dominate.rs b/src/test/compile-fail/match-range-fail-dominate.rs index 3f484511859f3..7c9c371c52674 100644 --- a/src/test/compile-fail/match-range-fail-dominate.rs +++ b/src/test/compile-fail/match-range-fail-dominate.rs @@ -39,9 +39,9 @@ fn main() { _ => {} }; - match 1.0 { - 0.01 .. 6.5 => {} - 0.02 => {} + match 1.0f64 { + 0.01f64 .. 6.5f64 => {} + 0.02f64 => {} _ => {} }; } diff --git a/src/test/compile-fail/match-vec-fixed.rs b/src/test/compile-fail/match-vec-fixed.rs index e778dd18e68d3..bac9fef2b1777 100644 --- a/src/test/compile-fail/match-vec-fixed.rs +++ b/src/test/compile-fail/match-vec-fixed.rs @@ -9,7 +9,7 @@ // except according to those terms. fn a() { - let v = [1, 2, 3]; + let v = [1i, 2, 3]; match v { [_, _, _] => {} [_, _, _] => {} //~ ERROR unreachable pattern diff --git a/src/test/compile-fail/moves-based-on-type-exprs.rs b/src/test/compile-fail/moves-based-on-type-exprs.rs index 82aa5c36c8e43..7a882b26db590 100644 --- a/src/test/compile-fail/moves-based-on-type-exprs.rs +++ b/src/test/compile-fail/moves-based-on-type-exprs.rs @@ -25,13 +25,13 @@ fn f10() { fn f20() { let x = "hi".to_string(); - let _y = (x, 3); + let _y = (x, 3i); touch(&x); //~ ERROR use of moved value: `x` } fn f21() { - let x = vec!(1, 2, 3); - let _y = (*x.get(0), 3); + let x = vec!(1i, 2, 3); + let _y = (*x.get(0), 3i); touch(&x); } @@ -62,9 +62,9 @@ fn f50(cond: bool) { let x = "hi".to_string(); let y = "ho".to_string(); let _y = match cond { - _ if guard(x) => 10, - true => 10, - false => 20, + _ if guard(x) => 10i, + true => 10i, + false => 20i, }; touch(&x); //~ ERROR use of moved value: `x` touch(&y); diff --git a/src/test/compile-fail/mut-cant-alias.rs b/src/test/compile-fail/mut-cant-alias.rs index 99d7258477ace..ce6e793d55d4d 100644 --- a/src/test/compile-fail/mut-cant-alias.rs +++ b/src/test/compile-fail/mut-cant-alias.rs @@ -11,7 +11,7 @@ use std::cell::RefCell; fn main() { - let m = RefCell::new(0); + let m = RefCell::new(0i); let mut b = m.borrow_mut(); let b1 = &mut *b; let b2 = &mut *b; //~ ERROR cannot borrow diff --git a/src/test/compile-fail/mut-not-freeze.rs b/src/test/compile-fail/mut-not-freeze.rs index f1e7ef216c32c..985bfec392c7f 100644 --- a/src/test/compile-fail/mut-not-freeze.rs +++ b/src/test/compile-fail/mut-not-freeze.rs @@ -13,6 +13,6 @@ use std::cell::RefCell; fn f(_: T) {} fn main() { - let x = RefCell::new(0); + let x = RefCell::new(0i); f(x); //~ ERROR: which does not fulfill `Share` } diff --git a/src/test/compile-fail/mut-ptr-cant-outlive-ref.rs b/src/test/compile-fail/mut-ptr-cant-outlive-ref.rs index 8e968d90a2f65..e269a736ce257 100644 --- a/src/test/compile-fail/mut-ptr-cant-outlive-ref.rs +++ b/src/test/compile-fail/mut-ptr-cant-outlive-ref.rs @@ -11,7 +11,7 @@ use std::cell::RefCell; fn main() { - let m = RefCell::new(0); + let m = RefCell::new(0i); let p; { let b = m.borrow(); diff --git a/src/test/compile-fail/no_send-rc.rs b/src/test/compile-fail/no_send-rc.rs index bf79d1393b837..291340e55b856 100644 --- a/src/test/compile-fail/no_send-rc.rs +++ b/src/test/compile-fail/no_send-rc.rs @@ -13,7 +13,7 @@ use std::rc::Rc; fn bar(_: T) {} fn main() { - let x = Rc::new(5); + let x = Rc::new(5i); bar(x); //~^ ERROR instantiating a type parameter with an incompatible type `alloc::rc::Rc`, // which does not fulfill `Send` diff --git a/src/test/compile-fail/no_share-rc.rs b/src/test/compile-fail/no_share-rc.rs index ad79d03821206..f49592b173587 100644 --- a/src/test/compile-fail/no_share-rc.rs +++ b/src/test/compile-fail/no_share-rc.rs @@ -14,7 +14,7 @@ use std::cell::RefCell; fn bar(_: T) {} fn main() { - let x = Rc::new(RefCell::new(5)); + let x = Rc::new(RefCell::new(5i)); bar(x); //~^ ERROR instantiating a type parameter with an incompatible type // `std::rc::Rc>`, which does not fulfill `Share` diff --git a/src/test/compile-fail/non-exhaustive-match.rs b/src/test/compile-fail/non-exhaustive-match.rs index cd78419439a96..4de4af877127d 100644 --- a/src/test/compile-fail/non-exhaustive-match.rs +++ b/src/test/compile-fail/non-exhaustive-match.rs @@ -16,10 +16,10 @@ fn main() { match true { //~ ERROR non-exhaustive patterns: `false` not covered true => {} } - match Some(10) { //~ ERROR non-exhaustive patterns: `Some(_)` not covered + match Some(10i) { //~ ERROR non-exhaustive patterns: `Some(_)` not covered None => {} } - match (2, 3, 4) { //~ ERROR non-exhaustive patterns: `(_, _, _)` not covered + match (2i, 3i, 4i) { //~ ERROR non-exhaustive patterns: `(_, _, _)` not covered (_, _, 4) => {} } match (a, a) { //~ ERROR non-exhaustive patterns: `(a, a)` not covered @@ -35,20 +35,20 @@ fn main() { (_, a) => {} (b, b) => {} } - let vec = vec!(Some(42), None, Some(21)); + let vec = vec!(Some(42i), None, Some(21i)); let vec: &[Option] = vec.as_slice(); match vec { //~ ERROR non-exhaustive patterns: `[]` not covered [Some(..), None, ..tail] => {} [Some(..), Some(..), ..tail] => {} [None] => {} } - let vec = vec!(1); + let vec = vec!(1i); let vec: &[int] = vec.as_slice(); match vec { [_, ..tail] => (), [] => () } - let vec = vec!(0.5); + let vec = vec!(0.5f32); let vec: &[f32] = vec.as_slice(); match vec { //~ ERROR non-exhaustive patterns: `[_, _, _, _]` not covered [0.1, 0.2, 0.3] => (), @@ -56,7 +56,7 @@ fn main() { [0.1] => (), [] => () } - let vec = vec!(Some(42), None, Some(21)); + let vec = vec!(Some(42i), None, Some(21i)); let vec: &[Option] = vec.as_slice(); match vec { [Some(..), None, ..tail] => {} diff --git a/src/test/compile-fail/refutable-pattern-errors.rs b/src/test/compile-fail/refutable-pattern-errors.rs index 9128ee68e26c5..28533518a25a1 100644 --- a/src/test/compile-fail/refutable-pattern-errors.rs +++ b/src/test/compile-fail/refutable-pattern-errors.rs @@ -13,6 +13,6 @@ fn func((1, (Some(1), 2..3)): (int, (Option, int))) { } //~^ ERROR refutable pattern in function argument: `(_, _)` not covered fn main() { - let (1, (Some(1), 2..3)) = (1, (None, 2)); + let (1i, (Some(1i), 2i..3i)) = (1i, (None, 2i)); //~^ ERROR refutable pattern in local binding: `(_, _)` not covered } diff --git a/src/test/compile-fail/regionck-closure-lifetimes.rs b/src/test/compile-fail/regionck-closure-lifetimes.rs index 731b045d0f322..846e03d57c3ae 100644 --- a/src/test/compile-fail/regionck-closure-lifetimes.rs +++ b/src/test/compile-fail/regionck-closure-lifetimes.rs @@ -13,9 +13,9 @@ fn env<'a>(blk: |p: ||: 'a|) { // the lifetime `'a`, which outlives the current // block. - let mut state = 0; + let mut state = 0i; let statep = &mut state; - blk(|| *statep = 1); //~ ERROR cannot infer + blk(|| *statep = 1i); //~ ERROR cannot infer } fn no_env_no_for<'a>(blk: |p: |||: 'a) { @@ -31,7 +31,7 @@ fn repeating_loop() { // external to the loop. let closure; - let state = 0; + let state = 0i; loop { closure = || state; //~ ERROR cannot infer @@ -47,7 +47,7 @@ fn repeating_while() { // external to the loop. let closure; - let state = 0; + let state = 0i; while true { closure = || state; //~ ERROR cannot infer diff --git a/src/test/compile-fail/regions-escape-loop-via-variable.rs b/src/test/compile-fail/regions-escape-loop-via-variable.rs index f588655d1afa8..472df87dd2b0d 100644 --- a/src/test/compile-fail/regions-escape-loop-via-variable.rs +++ b/src/test/compile-fail/regions-escape-loop-via-variable.rs @@ -9,7 +9,7 @@ // except according to those terms. fn main() { - let x = 3; + let x = 3i; // Here, the variable `p` gets inferred to a type with a lifetime // of the loop body. The regionck then determines that this type @@ -17,7 +17,7 @@ fn main() { let mut p = &x; loop { - let x = 1 + *p; + let x = 1i + *p; p = &x; //~ ERROR `x` does not live long enough } } diff --git a/src/test/compile-fail/regions-escape-loop-via-vec.rs b/src/test/compile-fail/regions-escape-loop-via-vec.rs index 89350f1616760..22c6bdd2d504c 100644 --- a/src/test/compile-fail/regions-escape-loop-via-vec.rs +++ b/src/test/compile-fail/regions-escape-loop-via-vec.rs @@ -10,7 +10,7 @@ // The type of `y` ends up getting inferred to the type of the block. fn broken() { - let mut x = 3; + let mut x = 3i; let mut _y = vec!(&mut x); while x < 10 { //~ ERROR cannot use `x` because it was mutably borrowed let mut z = x; //~ ERROR cannot use `x` because it was mutably borrowed diff --git a/src/test/compile-fail/static-assert2.rs b/src/test/compile-fail/static-assert2.rs index d5e70205e9536..6adc3b0aaf843 100644 --- a/src/test/compile-fail/static-assert2.rs +++ b/src/test/compile-fail/static-assert2.rs @@ -11,6 +11,6 @@ #![allow(dead_code)] #[static_assert] -static E: bool = 1 == 2; //~ ERROR static assertion failed +static E: bool = 1i == 2; //~ ERROR static assertion failed fn main() {} diff --git a/src/test/compile-fail/static-mut-not-pat.rs b/src/test/compile-fail/static-mut-not-pat.rs index 997003a28d423..c410e85655258 100644 --- a/src/test/compile-fail/static-mut-not-pat.rs +++ b/src/test/compile-fail/static-mut-not-pat.rs @@ -19,7 +19,7 @@ fn main() { // name as a variable, hence this should be an unreachable pattern situation // instead of spitting out a custom error about some identifier collisions // (we should allow shadowing) - match 4 { + match 4i { a => {} _ => {} //~ ERROR: unreachable pattern } diff --git a/src/test/compile-fail/static-region-bound.rs b/src/test/compile-fail/static-region-bound.rs index 880fbf0cb1d96..d78643ccd1046 100644 --- a/src/test/compile-fail/static-region-bound.rs +++ b/src/test/compile-fail/static-region-bound.rs @@ -15,8 +15,8 @@ use std::gc::GC; fn f(_: T) {} fn main() { - let x = box(GC) 3; + let x = box(GC) 3i; f(x); - let x = &3; + let x = &3i; f(x); //~ ERROR instantiating a type parameter with an incompatible type } diff --git a/src/test/compile-fail/typeck-unsafe-always-share.rs b/src/test/compile-fail/typeck-unsafe-always-share.rs index 6dec86ddf622f..72ef4a03eab72 100644 --- a/src/test/compile-fail/typeck-unsafe-always-share.rs +++ b/src/test/compile-fail/typeck-unsafe-always-share.rs @@ -28,7 +28,7 @@ fn test(s: T){ } fn main() { - let us = Unsafe::new(MyShare{u: Unsafe::new(0)}); + let us = Unsafe::new(MyShare{u: Unsafe::new(0i)}); test(us); let uns = Unsafe::new(NoShare{m: marker::NoShare}); diff --git a/src/test/compile-fail/unique-unique-kind.rs b/src/test/compile-fail/unique-unique-kind.rs index e8dc0fc3b6c28..67fbc08bd941b 100644 --- a/src/test/compile-fail/unique-unique-kind.rs +++ b/src/test/compile-fail/unique-unique-kind.rs @@ -16,6 +16,6 @@ fn f(_i: T) { } fn main() { - let i = box box(GC) 100; + let i = box box(GC) 100i; f(i); //~ ERROR does not fulfill `Send` } diff --git a/src/test/compile-fail/unreachable-code.rs b/src/test/compile-fail/unreachable-code.rs index 96adb29cbc80d..fb9a6b5201897 100644 --- a/src/test/compile-fail/unreachable-code.rs +++ b/src/test/compile-fail/unreachable-code.rs @@ -14,5 +14,5 @@ fn main() { loop{} - let a = 3; //~ ERROR: unreachable statement + let a = 3i; //~ ERROR: unreachable statement } diff --git a/src/test/compile-fail/unsized3.rs b/src/test/compile-fail/unsized3.rs index c321871c40f2c..c5cc7e8f7163b 100644 --- a/src/test/compile-fail/unsized3.rs +++ b/src/test/compile-fail/unsized3.rs @@ -51,8 +51,8 @@ fn f8(x1: &S, x2: &S) { // Test some tuples. fn f9(x1: Box>, x2: Box>) { - f5(&(*x1, 34)); //~ERROR instantiating a type parameter with an incompatible type `(S,int)`, - f5(&(32, *x2)); //~ERROR instantiating a type parameter with an incompatible type `(int,E)`, + f5(&(*x1, 34i)); //~ERROR instantiating a type parameter with an incompatible type `(S,int)`, + f5(&(32i, *x2)); //~ERROR instantiating a type parameter with an incompatible type `(int,E)`, } // I would like these to fail eventually. diff --git a/src/test/compile-fail/unsized6.rs b/src/test/compile-fail/unsized6.rs index 9916fdba20f6e..061b003b5e3f0 100644 --- a/src/test/compile-fail/unsized6.rs +++ b/src/test/compile-fail/unsized6.rs @@ -29,12 +29,12 @@ fn f2(x: &X) { fn f3(x1: Box, x2: Box, x3: Box) { let y: X = *x1; //~ERROR variable `y` has dynamically sized type `X` let y = *x2; //~ERROR variable `y` has dynamically sized type `X` - let (y, z) = (*x3, 4); //~ERROR variable `y` has dynamically sized type `X` + let (y, z) = (*x3, 4i); //~ERROR variable `y` has dynamically sized type `X` } fn f4(x1: Box, x2: Box, x3: Box) { let y: X = *x1; //~ERROR variable `y` has dynamically sized type `X` let y = *x2; //~ERROR variable `y` has dynamically sized type `X` - let (y, z) = (*x3, 4); //~ERROR variable `y` has dynamically sized type `X` + let (y, z) = (*x3, 4i); //~ERROR variable `y` has dynamically sized type `X` } fn g1(x: X) {} //~ERROR variable `x` has dynamically sized type `X` diff --git a/src/test/compile-fail/vec-mut-iter-borrow.rs b/src/test/compile-fail/vec-mut-iter-borrow.rs index a3c7fc2d4c8af..9a179f434c275 100644 --- a/src/test/compile-fail/vec-mut-iter-borrow.rs +++ b/src/test/compile-fail/vec-mut-iter-borrow.rs @@ -9,7 +9,7 @@ // except according to those terms. fn main() { - let mut xs = vec!(1, 2, 3, 4); + let mut xs = vec!(1i, 2, 3, 4); for x in xs.mut_iter() { xs.push(1) //~ ERROR cannot borrow `xs` diff --git a/src/test/compile-fail/warn-path-statement.rs b/src/test/compile-fail/warn-path-statement.rs index 90515807ac6cc..8b6d160a6c5a9 100644 --- a/src/test/compile-fail/warn-path-statement.rs +++ b/src/test/compile-fail/warn-path-statement.rs @@ -11,6 +11,6 @@ // compile-flags: -D path-statement fn main() { - let x = 10; + let x = 10i; x; //~ ERROR path statement with no effect } diff --git a/src/test/debuginfo/basic-types-metadata.rs b/src/test/debuginfo/basic-types-metadata.rs index da32518d9936d..51d2f36cc78b6 100644 --- a/src/test/debuginfo/basic-types-metadata.rs +++ b/src/test/debuginfo/basic-types-metadata.rs @@ -67,7 +67,7 @@ fn main() { let f32: f32 = 2.5; let f64: f64 = 3.5; _zzz(); - if 1 == 1 { _yyy(); } + if 1i == 1 { _yyy(); } } fn _zzz() {()} diff --git a/src/test/debuginfo/box.rs b/src/test/debuginfo/box.rs index 01129c845e9ea..dcfe1804510ad 100644 --- a/src/test/debuginfo/box.rs +++ b/src/test/debuginfo/box.rs @@ -30,9 +30,9 @@ use std::gc::GC; fn main() { - let a = box 1; - let b = box() (2, 3.5); - let c = box(GC) 4; + let a = box 1i; + let b = box() (2i, 3.5f64); + let c = box(GC) 4i; let d = box(GC) false; _zzz(); } diff --git a/src/test/debuginfo/closure-in-generic-function.rs b/src/test/debuginfo/closure-in-generic-function.rs index 7a89b682d1533..cc241040f2bd2 100644 --- a/src/test/debuginfo/closure-in-generic-function.rs +++ b/src/test/debuginfo/closure-in-generic-function.rs @@ -39,8 +39,8 @@ fn some_generic_fun(a: T1, b: T2) -> (T2, T1) { } fn main() { - some_generic_fun(0.5, 10); - some_generic_fun(&29, box 110); + some_generic_fun(0.5f64, 10i); + some_generic_fun(&29i, box 110i); } fn zzz() {()} diff --git a/src/test/debuginfo/destructured-local.rs b/src/test/debuginfo/destructured-local.rs index c543a11475e06..d91d98f43050f 100644 --- a/src/test/debuginfo/destructured-local.rs +++ b/src/test/debuginfo/destructured-local.rs @@ -156,7 +156,7 @@ fn main() { let Struct { a: k, b: l } = Struct { a: 12, b: 13 }; // ignored tuple element - let (m, _, n) = (14, 15, 16); + let (m, _, n) = (14i, 15i, 16i); // ignored struct field let Struct { b: o, .. } = Struct { a: 17, b: 18 }; @@ -169,25 +169,25 @@ fn main() { // complex nesting let ((u, v), ((w, (x, Struct { a: y, b: z})), Struct { a: ae, b: oe }), ue) = - ((25, 26), ((27, (28, Struct { a: 29, b: 30})), Struct { a: 31, b: 32 }), 33); + ((25i, 26i), ((27i, (28i, Struct { a: 29, b: 30})), Struct { a: 31, b: 32 }), 33i); // reference - let &aa = &(34, 35); + let &aa = &(34i, 35i); // reference - let &bb = &(36, 37); + let &bb = &(36i, 37i); // contained reference - let (&cc, _) = (&38, 39); + let (&cc, _) = (&38i, 39i); // unique pointer - let box dd = box() (40, 41, 42); + let box dd = box() (40i, 41i, 42i); // ref binding - let ref ee = (43, 44, 45); + let ref ee = (43i, 44i, 45i); // ref binding in tuple - let (ref ff, gg) = (46, (47, 48)); + let (ref ff, gg) = (46i, (47i, 48i)); // ref binding in struct let Struct { b: ref hh, .. } = Struct { a: 49, b: 50 }; diff --git a/src/test/debuginfo/function-arg-initialization.rs b/src/test/debuginfo/function-arg-initialization.rs index d439f49fe6925..535efa0b84efc 100644 --- a/src/test/debuginfo/function-arg-initialization.rs +++ b/src/test/debuginfo/function-arg-initialization.rs @@ -155,7 +155,7 @@ fn non_immediate_args(a: BigStruct, b: BigStruct) { } fn binding(a: i64, b: u64, c: f64) { - let x = 0; + let x = 0i; } fn assignment(mut a: u64, b: u64, c: f64) { diff --git a/src/test/debuginfo/function-prologue-stepping-no-split-stack.rs b/src/test/debuginfo/function-prologue-stepping-no-split-stack.rs index a9ccf3cdb161b..0160a6f1879db 100644 --- a/src/test/debuginfo/function-prologue-stepping-no-split-stack.rs +++ b/src/test/debuginfo/function-prologue-stepping-no-split-stack.rs @@ -152,7 +152,7 @@ fn non_immediate_args(a: BigStruct, b: BigStruct) { #[no_split_stack] fn binding(a: i64, b: u64, c: f64) { - let x = 0; + let x = 0i; } #[no_split_stack] diff --git a/src/test/debuginfo/generic-functions-nested.rs b/src/test/debuginfo/generic-functions-nested.rs index d9b20a84cddf4..1805405dc1ef5 100644 --- a/src/test/debuginfo/generic-functions-nested.rs +++ b/src/test/debuginfo/generic-functions-nested.rs @@ -43,8 +43,8 @@ // gdb-command:continue fn outer(a: TA) { - inner(a.clone(), 1); - inner(a.clone(), 2.5); + inner(a.clone(), 1i); + inner(a.clone(), 2.5f64); fn inner(x: TX, y: TY) { zzz(); diff --git a/src/test/debuginfo/generic-method-on-generic-struct.rs b/src/test/debuginfo/generic-method-on-generic-struct.rs index ad088d9a5eba6..9ed1c0175a91b 100644 --- a/src/test/debuginfo/generic-method-on-generic-struct.rs +++ b/src/test/debuginfo/generic-method-on-generic-struct.rs @@ -91,7 +91,7 @@ fn main() { let _ = stack.self_by_ref(-1, -2_i8); let _ = stack.self_by_val(-3, -4_i16); - let owned = box Struct { x: 1234.5 }; + let owned = box Struct { x: 1234.5f64 }; let _ = owned.self_by_ref(-5, -6_i32); let _ = owned.self_by_val(-7, -8_i64); let _ = owned.self_owned(-9, -10.5_f32); diff --git a/src/test/debuginfo/generic-static-method-on-struct-and-enum.rs b/src/test/debuginfo/generic-static-method-on-struct-and-enum.rs index 82a9d7089666f..b62b6f186b9aa 100644 --- a/src/test/debuginfo/generic-static-method-on-struct-and-enum.rs +++ b/src/test/debuginfo/generic-static-method-on-struct-and-enum.rs @@ -61,8 +61,8 @@ impl Enum { } fn main() { - Struct::static_method(1, 2); - Enum::static_method(-3, 4.5, 5); + Struct::static_method(1i, 2i); + Enum::static_method(-3i, 4.5f64, 5i); } fn zzz() {()} diff --git a/src/test/debuginfo/generic-struct-style-enum.rs b/src/test/debuginfo/generic-struct-style-enum.rs index eddf4dfd7553e..7fec116b8e582 100644 --- a/src/test/debuginfo/generic-struct-style-enum.rs +++ b/src/test/debuginfo/generic-struct-style-enum.rs @@ -72,7 +72,7 @@ fn main() { // 0b01011001 = 89 let case3: Regular = Case3 { a: 0, b: 6438275382588823897 }; - let univariant = TheOnlyCase { a: -1 }; + let univariant = TheOnlyCase { a: -1i }; zzz(); } diff --git a/src/test/debuginfo/generic-struct.rs b/src/test/debuginfo/generic-struct.rs index 69217f4b87851..a2c5a0973fca4 100644 --- a/src/test/debuginfo/generic-struct.rs +++ b/src/test/debuginfo/generic-struct.rs @@ -31,10 +31,13 @@ struct AGenericStruct { fn main() { - let int_int = AGenericStruct { key: 0, value: 1 }; - let int_float = AGenericStruct { key: 2, value: 3.5 }; - let float_int = AGenericStruct { key: 4.5, value: 5 }; - let float_int_float = AGenericStruct { key: 6.5, value: AGenericStruct { key: 7, value: 8.5 } }; + let int_int = AGenericStruct { key: 0i, value: 1i }; + let int_float = AGenericStruct { key: 2i, value: 3.5f64 }; + let float_int = AGenericStruct { key: 4.5f64, value: 5i }; + let float_int_float = AGenericStruct { + key: 6.5f64, + value: AGenericStruct { key: 7i, value: 8.5f64 }, + }; zzz(); } diff --git a/src/test/debuginfo/lexical-scope-in-for-loop.rs b/src/test/debuginfo/lexical-scope-in-for-loop.rs index 0f6ac953179f3..0fb823a74cc72 100644 --- a/src/test/debuginfo/lexical-scope-in-for-loop.rs +++ b/src/test/debuginfo/lexical-scope-in-for-loop.rs @@ -55,15 +55,15 @@ fn main() { - let range = [1, 2, 3]; + let range = [1i, 2, 3]; - let x = 1000000; // wan meeeljen doollaars! + let x = 1000000i; // wan meeeljen doollaars! for &x in range.iter() { zzz(); sentinel(); - let x = -1 * x; + let x = -1i * x; zzz(); sentinel(); diff --git a/src/test/debuginfo/lexical-scope-in-if.rs b/src/test/debuginfo/lexical-scope-in-if.rs index ef573735d0d4c..6018e62af0078 100644 --- a/src/test/debuginfo/lexical-scope-in-if.rs +++ b/src/test/debuginfo/lexical-scope-in-if.rs @@ -80,8 +80,8 @@ fn main() { - let x = 999; - let y = -1; + let x = 999i; + let y = -1i; zzz(); sentinel(); @@ -90,13 +90,13 @@ fn main() { zzz(); sentinel(); - let x = 1001; + let x = 1001i; zzz(); sentinel(); - let x = 1002; - let y = 1003; + let x = 1002i; + let y = 1003i; zzz(); sentinel(); } else { @@ -112,8 +112,8 @@ fn main() { zzz(); sentinel(); - let x = 1004; - let y = 1005; + let x = 1004i; + let y = 1005i; zzz(); sentinel(); } diff --git a/src/test/debuginfo/lexical-scope-in-match.rs b/src/test/debuginfo/lexical-scope-in-match.rs index b347afbbbcdb5..7bec677e4b100 100644 --- a/src/test/debuginfo/lexical-scope-in-match.rs +++ b/src/test/debuginfo/lexical-scope-in-match.rs @@ -81,13 +81,13 @@ struct Struct { fn main() { - let shadowed = 231; - let not_shadowed = 232; + let shadowed = 231i; + let not_shadowed = 232i; zzz(); sentinel(); - match (233, 234) { + match (233i, 234i) { (shadowed, local_to_arm) => { zzz(); @@ -95,7 +95,7 @@ fn main() { } } - match (235, 236) { + match (235i, 236i) { // with literal (235, shadowed) => { @@ -132,7 +132,7 @@ fn main() { _ => {} } - match (243, 244) { + match (243i, 244i) { (shadowed, ref local_to_arm) => { zzz(); diff --git a/src/test/debuginfo/lexical-scope-in-parameterless-closure.rs b/src/test/debuginfo/lexical-scope-in-parameterless-closure.rs index ad8f04d1fc795..0e47f2c9921fc 100644 --- a/src/test/debuginfo/lexical-scope-in-parameterless-closure.rs +++ b/src/test/debuginfo/lexical-scope-in-parameterless-closure.rs @@ -16,6 +16,6 @@ // Nothing to do here really, just make sure it compiles. See issue #8513. fn main() { let _ = ||(); - let _ = range(1u,3).map(|_| 5); + let _ = range(1u,3).map(|_| 5i); } diff --git a/src/test/debuginfo/lexical-scope-in-stack-closure.rs b/src/test/debuginfo/lexical-scope-in-stack-closure.rs index c56cdbe031502..0168eaa86c2d1 100644 --- a/src/test/debuginfo/lexical-scope-in-stack-closure.rs +++ b/src/test/debuginfo/lexical-scope-in-stack-closure.rs @@ -55,7 +55,7 @@ fn main() { zzz(); sentinel(); - let x = 2.5; + let x = 2.5f64; zzz(); sentinel(); diff --git a/src/test/debuginfo/lexical-scope-in-unconditional-loop.rs b/src/test/debuginfo/lexical-scope-in-unconditional-loop.rs index 12e95c4f9c743..48edd7ae12a09 100644 --- a/src/test/debuginfo/lexical-scope-in-unconditional-loop.rs +++ b/src/test/debuginfo/lexical-scope-in-unconditional-loop.rs @@ -84,7 +84,7 @@ fn main() { - let mut x = 0; + let mut x = 0i; loop { if x >= 2 { @@ -108,7 +108,7 @@ fn main() { zzz(); sentinel(); - let x = -987; + let x = -987i; zzz(); sentinel(); diff --git a/src/test/debuginfo/lexical-scope-in-unique-closure.rs b/src/test/debuginfo/lexical-scope-in-unique-closure.rs index 328910b0f1341..ce3b2a530e2c2 100644 --- a/src/test/debuginfo/lexical-scope-in-unique-closure.rs +++ b/src/test/debuginfo/lexical-scope-in-unique-closure.rs @@ -55,7 +55,7 @@ fn main() { zzz(); sentinel(); - let x = 2.5; + let x = 2.5f64; zzz(); sentinel(); diff --git a/src/test/debuginfo/lexical-scope-in-while.rs b/src/test/debuginfo/lexical-scope-in-while.rs index 1b2a9f7518296..d726eb6581eb2 100644 --- a/src/test/debuginfo/lexical-scope-in-while.rs +++ b/src/test/debuginfo/lexical-scope-in-while.rs @@ -84,7 +84,7 @@ fn main() { - let mut x = 0; + let mut x = 0i; while x < 2 { zzz(); @@ -104,7 +104,7 @@ fn main() { zzz(); sentinel(); - let x = -987; + let x = -987i; zzz(); sentinel(); diff --git a/src/test/debuginfo/lexical-scope-with-macro.rs b/src/test/debuginfo/lexical-scope-with-macro.rs index 3fb6f10fe332b..e55271239d488 100644 --- a/src/test/debuginfo/lexical-scope-with-macro.rs +++ b/src/test/debuginfo/lexical-scope-with-macro.rs @@ -77,7 +77,7 @@ macro_rules! no_new_scope( macro_rules! new_scope( () => ({ - let a = 890242; + let a = 890242i; zzz(); sentinel(); }) @@ -105,8 +105,8 @@ macro_rules! dup_expr( fn main() { - let a = trivial!(10); - let b = no_new_scope!(33); + let a = trivial!(10i); + let b = no_new_scope!(33i); zzz(); sentinel(); @@ -116,12 +116,12 @@ fn main() { zzz(); sentinel(); - shadow_within_macro!(100); + shadow_within_macro!(100i); zzz(); sentinel(); - let c = dup_expr!(10 * 20); + let c = dup_expr!(10i * 20); zzz(); sentinel(); diff --git a/src/test/debuginfo/lexical-scopes-in-block-expression.rs b/src/test/debuginfo/lexical-scopes-in-block-expression.rs index 41b88dc3e981d..2a9969dc6e903 100644 --- a/src/test/debuginfo/lexical-scopes-in-block-expression.rs +++ b/src/test/debuginfo/lexical-scopes-in-block-expression.rs @@ -227,8 +227,8 @@ fn a_function(x: int) -> int { fn main() { - let val = -1; - let ten = 10; + let val = -1i; + let ten = 10i; // surrounded by struct expression let point = Point { @@ -280,7 +280,7 @@ fn main() { sentinel(); val - }, 0); + }, 0i); zzz(); sentinel(); @@ -355,7 +355,7 @@ fn main() { sentinel(); // index expression - let a_vector = [10, ..20]; + let a_vector = [10i, ..20]; let _ = a_vector[{ zzz(); sentinel(); diff --git a/src/test/debuginfo/limited-debuginfo.rs b/src/test/debuginfo/limited-debuginfo.rs index 616f312c07846..9cda2c45131db 100644 --- a/src/test/debuginfo/limited-debuginfo.rs +++ b/src/test/debuginfo/limited-debuginfo.rs @@ -46,7 +46,7 @@ fn zzz() {()} fn some_function(a: int, b: int) { let some_variable = Struct { a: 11, b: 22 }; - let some_other_variable = 23; + let some_other_variable = 23i; zzz(); } diff --git a/src/test/debuginfo/managed-pointer-within-unique.rs b/src/test/debuginfo/managed-pointer-within-unique.rs index b56db2d18468e..cc18ea64f383e 100644 --- a/src/test/debuginfo/managed-pointer-within-unique.rs +++ b/src/test/debuginfo/managed-pointer-within-unique.rs @@ -37,9 +37,9 @@ struct ContainsManaged { } fn main() { - let ordinary_unique = box() (-1, -2); + let ordinary_unique = box() (-1i, -2i); - let managed_within_unique = box ContainsManaged { x: -3, y: box(GC) -4 }; + let managed_within_unique = box ContainsManaged { x: -3, y: box(GC) -4i }; zzz(); } diff --git a/src/test/debuginfo/method-on-generic-struct.rs b/src/test/debuginfo/method-on-generic-struct.rs index 2f7b0c845ea80..0bac86b1e66aa 100644 --- a/src/test/debuginfo/method-on-generic-struct.rs +++ b/src/test/debuginfo/method-on-generic-struct.rs @@ -91,7 +91,7 @@ fn main() { let _ = stack.self_by_ref(-1, -2); let _ = stack.self_by_val(-3, -4); - let owned = box Struct { x: 1234.5 }; + let owned = box Struct { x: 1234.5f64 }; let _ = owned.self_by_ref(-5, -6); let _ = owned.self_by_val(-7, -8); let _ = owned.self_owned(-9, -10); diff --git a/src/test/debuginfo/multiple-functions-equal-var-names.rs b/src/test/debuginfo/multiple-functions-equal-var-names.rs index 510718254d904..9e40f03c20162 100644 --- a/src/test/debuginfo/multiple-functions-equal-var-names.rs +++ b/src/test/debuginfo/multiple-functions-equal-var-names.rs @@ -31,18 +31,18 @@ #![allow(unused_variable)] fn function_one() { - let abc = 10101; + let abc = 10101i; zzz(); } fn function_two() { - let abc = 20202; + let abc = 20202i; zzz(); } fn function_three() { - let abc = 30303; + let abc = 30303i; zzz(); } diff --git a/src/test/debuginfo/multiple-functions.rs b/src/test/debuginfo/multiple-functions.rs index 362a8a93dd19b..ef1c69f9eb8cf 100644 --- a/src/test/debuginfo/multiple-functions.rs +++ b/src/test/debuginfo/multiple-functions.rs @@ -31,18 +31,18 @@ #![allow(unused_variable)] fn function_one() { - let a = 10101; + let a = 10101i; zzz(); } fn function_two() { - let b = 20202; + let b = 20202i; zzz(); } fn function_three() { - let c = 30303; + let c = 30303i; zzz(); } diff --git a/src/test/debuginfo/name-shadowing-and-scope-nesting.rs b/src/test/debuginfo/name-shadowing-and-scope-nesting.rs index f967ced38ec11..8ee6d434016f0 100644 --- a/src/test/debuginfo/name-shadowing-and-scope-nesting.rs +++ b/src/test/debuginfo/name-shadowing-and-scope-nesting.rs @@ -63,25 +63,25 @@ fn main() { zzz(); sentinel(); - let x = 10; + let x = 10i; zzz(); sentinel(); - let x = 10.5; - let y = 20; + let x = 10.5f64; + let y = 20i; zzz(); sentinel(); { let x = true; - let y = 2220; + let y = 2220i; zzz(); sentinel(); - let x = 203203.5; + let x = 203203.5f64; zzz(); sentinel(); diff --git a/src/test/debuginfo/option-like-enum.rs b/src/test/debuginfo/option-like-enum.rs index 04cd7e1386324..de6d6814308d8 100644 --- a/src/test/debuginfo/option-like-enum.rs +++ b/src/test/debuginfo/option-like-enum.rs @@ -72,18 +72,18 @@ struct NamedFieldsRepr<'a> { fn main() { - let some: Option<&u32> = Some(unsafe { std::mem::transmute(0x12345678) }); + let some: Option<&u32> = Some(unsafe { std::mem::transmute(0x12345678u) }); let none: Option<&u32> = None; - let full = Full(454545, unsafe { std::mem::transmute(0x87654321) }, 9988); + let full = Full(454545, unsafe { std::mem::transmute(0x87654321u) }, 9988); - let int_val = 0; + let int_val = 0i; let empty: &MoreFieldsRepr = unsafe { std::mem::transmute(&Empty) }; let droid = Droid { id: 675675, range: 10000001, - internals: unsafe { std::mem::transmute(0x43218765) } + internals: unsafe { std::mem::transmute(0x43218765u) } }; let void_droid: &NamedFieldsRepr = unsafe { std::mem::transmute(&Void) }; diff --git a/src/test/debuginfo/shadowed-argument.rs b/src/test/debuginfo/shadowed-argument.rs index 129263c0f7649..c180d6b5bcfe7 100644 --- a/src/test/debuginfo/shadowed-argument.rs +++ b/src/test/debuginfo/shadowed-argument.rs @@ -39,13 +39,13 @@ fn a_function(x: bool, y: bool) { zzz(); sentinel(); - let x = 10; + let x = 10i; zzz(); sentinel(); - let x = 10.5; - let y = 20; + let x = 10.5f64; + let y = 20i; zzz(); sentinel(); diff --git a/src/test/debuginfo/shadowed-variable.rs b/src/test/debuginfo/shadowed-variable.rs index 825ecb9c0ca7f..88ef3c4879e90 100644 --- a/src/test/debuginfo/shadowed-variable.rs +++ b/src/test/debuginfo/shadowed-variable.rs @@ -42,13 +42,13 @@ fn main() { zzz(); sentinel(); - let x = 10; + let x = 10i; zzz(); sentinel(); - let x = 10.5; - let y = 20; + let x = 10.5f64; + let y = 20i; zzz(); sentinel(); diff --git a/src/test/debuginfo/simple-lexical-scope.rs b/src/test/debuginfo/simple-lexical-scope.rs index 171e3eae659f1..107b64131e053 100644 --- a/src/test/debuginfo/simple-lexical-scope.rs +++ b/src/test/debuginfo/simple-lexical-scope.rs @@ -60,7 +60,7 @@ fn main() { zzz(); sentinel(); - let x = 10; + let x = 10i; zzz(); sentinel(); @@ -69,7 +69,7 @@ fn main() { zzz(); sentinel(); - let x = 10.5; + let x = 10.5f64; zzz(); sentinel(); diff --git a/src/test/debuginfo/vec.rs b/src/test/debuginfo/vec.rs index 11f317469a27c..155865f415b63 100644 --- a/src/test/debuginfo/vec.rs +++ b/src/test/debuginfo/vec.rs @@ -26,7 +26,7 @@ static mut VECT: [i32, ..3] = [1, 2, 3]; fn main() { - let a = [1, 2, 3]; + let a = [1i, 2, 3]; unsafe { VECT[0] = 4; diff --git a/src/test/pretty/block-disambig.rs b/src/test/pretty/block-disambig.rs index 20d634d047535..9433ddf1a1fc8 100644 --- a/src/test/pretty/block-disambig.rs +++ b/src/test/pretty/block-disambig.rs @@ -17,9 +17,9 @@ use std::cell::Cell; use std::gc::GC; -fn test1() { let val = box(GC) 0; { } *val; } +fn test1() { let val = box(GC) 0i; { } *val; } -fn test2() -> int { let val = box(GC) 0; { } *val } +fn test2() -> int { let val = box(GC) 0i; { } *val } struct S { eax: int } @@ -36,13 +36,13 @@ fn test5() -> (int, int) { { } (0, 1) } fn test6() -> bool { { } (true || false) && true } fn test7() -> uint { - let regs = box(GC) 0; + let regs = box(GC) 0i; match true { true => { } _ => { } } (*regs < 2) as uint } fn test8() -> int { - let val = box(GC) 0; + let val = box(GC) 0i; match true { true => { } _ => { } @@ -55,12 +55,12 @@ fn test8() -> int { } fn test9() { - let regs = box(GC) Cell::new(0); + let regs = box(GC) Cell::new(0i); match true { true => { } _ => { } } regs.set(regs.get() + 1); } fn test10() -> int { - let regs = box(GC) vec!(0); + let regs = box(GC) vec!(0i); match true { true => { } _ => { } } *(*regs).get(0) } diff --git a/src/test/pretty/issue-929.rs b/src/test/pretty/issue-929.rs index 636fac82b6b00..85b71e4e86cc7 100644 --- a/src/test/pretty/issue-929.rs +++ b/src/test/pretty/issue-929.rs @@ -8,6 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn f() { if (1 == fail!()) { } else { } } +fn f() { if (1i == fail!()) { } else { } } fn main() { } diff --git a/src/test/pretty/match-naked-expr-medium.rs b/src/test/pretty/match-naked-expr-medium.rs index 5cf6d838f253f..c03ad49947892 100644 --- a/src/test/pretty/match-naked-expr-medium.rs +++ b/src/test/pretty/match-naked-expr-medium.rs @@ -11,7 +11,7 @@ // pp-exact fn main() { - let x = Some(3); + let x = Some(3i); let _y = match x { Some(_) => diff --git a/src/test/pretty/match-naked-expr.rs b/src/test/pretty/match-naked-expr.rs index bb14a74fc183e..67c389f7e1f08 100644 --- a/src/test/pretty/match-naked-expr.rs +++ b/src/test/pretty/match-naked-expr.rs @@ -11,7 +11,7 @@ // pp-exact fn main() { - let x = Some(3); + let x = Some(3i); let _y = match x { Some(_) => "some(_)".to_string(), diff --git a/src/test/pretty/unary-op-disambig.rs b/src/test/pretty/unary-op-disambig.rs index 1592e010aaff7..850904fe53e44 100644 --- a/src/test/pretty/unary-op-disambig.rs +++ b/src/test/pretty/unary-op-disambig.rs @@ -18,10 +18,10 @@ fn block_nosemi() -> int { ({ 0 }) - 1 } fn if_semi() -> int { if true { f() } else { f() }; -1 } -fn if_nosemi() -> int { (if true { 0 } else { 0 }) - 1 } +fn if_nosemi() -> int { (if true { 0i } else { 0i }) - 1 } fn alt_semi() -> int { match true { true => { f() } _ => { } }; -1 } fn alt_no_semi() -> int { (match true { true => { 0 } _ => { 1 } }) - 1 } -fn stmt() { { f() }; -1; } +fn stmt() { { f() }; -1i; } diff --git a/src/test/pretty/vec-comments.pp b/src/test/pretty/vec-comments.pp index dc2dae1044dac..401c63efbc468 100644 --- a/src/test/pretty/vec-comments.pp +++ b/src/test/pretty/vec-comments.pp @@ -15,25 +15,25 @@ let _v1 = [ // Comment - 0, + 0i, // Comment - 1, + 1i, // Comment - 2]; + 2i]; let _v2 = - [0, // Comment - 1, // Comment - 2]; // Comment + [0i, // Comment + 1i, // Comment + 2i]; // Comment let _v3 = [ /* Comment */ - 0, + 0i, /* Comment */ - 1, + 1i, /* Comment */ - 2]; + 2i]; let _v4 = - [0, /* Comment */ - 1, /* Comment */ - 2]; /* Comment */ + [0i, /* Comment */ + 1i, /* Comment */ + 2i]; /* Comment */ } diff --git a/src/test/pretty/vec-comments.rs b/src/test/pretty/vec-comments.rs index dc2dae1044dac..401c63efbc468 100644 --- a/src/test/pretty/vec-comments.rs +++ b/src/test/pretty/vec-comments.rs @@ -15,25 +15,25 @@ fn main() { let _v1 = [ // Comment - 0, + 0i, // Comment - 1, + 1i, // Comment - 2]; + 2i]; let _v2 = - [0, // Comment - 1, // Comment - 2]; // Comment + [0i, // Comment + 1i, // Comment + 2i]; // Comment let _v3 = [ /* Comment */ - 0, + 0i, /* Comment */ - 1, + 1i, /* Comment */ - 2]; + 2i]; let _v4 = - [0, /* Comment */ - 1, /* Comment */ - 2]; /* Comment */ + [0i, /* Comment */ + 1i, /* Comment */ + 2i]; /* Comment */ } diff --git a/src/test/run-fail/assert-as-macro.rs b/src/test/run-fail/assert-as-macro.rs index c52c11b1b9188..fb069e61bd2a1 100644 --- a/src/test/run-fail/assert-as-macro.rs +++ b/src/test/run-fail/assert-as-macro.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:assertion failed: 1 == 2 +// error-pattern:assertion failed: 1i == 2 fn main() { - assert!(1 == 2); + assert!(1i == 2); } diff --git a/src/test/run-fail/bounds-check-no-overflow.rs b/src/test/run-fail/bounds-check-no-overflow.rs index be4ad0781f272..df9050e218631 100644 --- a/src/test/run-fail/bounds-check-no-overflow.rs +++ b/src/test/run-fail/bounds-check-no-overflow.rs @@ -14,6 +14,6 @@ use std::uint; use std::mem::size_of; fn main() { - let xs = [1, 2, 3]; + let xs = [1i, 2, 3]; xs[uint::MAX / size_of::() + 1]; } diff --git a/src/test/run-fail/divide-by-zero.rs b/src/test/run-fail/divide-by-zero.rs index de69b7b9fa670..c58d30f272996 100644 --- a/src/test/run-fail/divide-by-zero.rs +++ b/src/test/run-fail/divide-by-zero.rs @@ -10,6 +10,6 @@ // error-pattern:attempted to divide by zero fn main() { - let y = 0; - let _z = 1 / y; + let y = 0i; + let _z = 1i / y; } diff --git a/src/test/run-fail/explicit-fail-msg.rs b/src/test/run-fail/explicit-fail-msg.rs index f860fdffba1a3..4af9b82ec7e22 100644 --- a/src/test/run-fail/explicit-fail-msg.rs +++ b/src/test/run-fail/explicit-fail-msg.rs @@ -13,7 +13,7 @@ // error-pattern:wooooo fn main() { - let mut a = 1; - if 1 == 1 { a = 2; } + let mut a = 1i; + if 1i == 1 { a = 2; } fail!(format!("woooo{}", "o")); } diff --git a/src/test/run-fail/expr-if-fail.rs b/src/test/run-fail/expr-if-fail.rs index 73259e6e140f5..55d86bc649324 100644 --- a/src/test/run-fail/expr-if-fail.rs +++ b/src/test/run-fail/expr-if-fail.rs @@ -12,4 +12,4 @@ // error-pattern:explicit failure -fn main() { let _x = if false { 0 } else if true { fail!() } else { 10 }; } +fn main() { let _x = if false { 0i } else if true { fail!() } else { 10i }; } diff --git a/src/test/run-fail/expr-match-fail.rs b/src/test/run-fail/expr-match-fail.rs index 075f6f5b4b190..d15ec3f7b486a 100644 --- a/src/test/run-fail/expr-match-fail.rs +++ b/src/test/run-fail/expr-match-fail.rs @@ -12,4 +12,4 @@ // error-pattern:explicit failure -fn main() { let _x = match true { false => { 0 } true => { fail!() } }; } +fn main() { let _x = match true { false => { 0i } true => { fail!() } }; } diff --git a/src/test/run-fail/fail-task-name-owned.rs b/src/test/run-fail/fail-task-name-owned.rs index b1c8963e684d6..edb03b2d6b461 100644 --- a/src/test/run-fail/fail-task-name-owned.rs +++ b/src/test/run-fail/fail-task-name-owned.rs @@ -16,7 +16,7 @@ fn main() { let r: Result = TaskBuilder::new().named("owned name".to_string()) .try(proc() { fail!("test"); - 1 + 1i }); assert!(r.is_ok()); } diff --git a/src/test/run-fail/fail-task-name-send-str.rs b/src/test/run-fail/fail-task-name-send-str.rs index 5153c5f2807b0..0a74009977828 100644 --- a/src/test/run-fail/fail-task-name-send-str.rs +++ b/src/test/run-fail/fail-task-name-send-str.rs @@ -15,7 +15,7 @@ fn main() { ::std::task::TaskBuilder::new().named("send name".into_maybe_owned()) .try(proc() { fail!("test"); - 3 + 3i }); assert!(r.is_ok()); } diff --git a/src/test/run-fail/fail.rs b/src/test/run-fail/fail.rs index 42cf79af66ee8..54ccc98bcd924 100644 --- a/src/test/run-fail/fail.rs +++ b/src/test/run-fail/fail.rs @@ -11,5 +11,5 @@ -// error-pattern:1 == 2 -fn main() { assert!((1 == 2)); } +// error-pattern:1i == 2 +fn main() { assert!((1i == 2)); } diff --git a/src/test/run-fail/issue-3029.rs b/src/test/run-fail/issue-3029.rs index a57f4683df315..80e275019ce24 100644 --- a/src/test/run-fail/issue-3029.rs +++ b/src/test/run-fail/issue-3029.rs @@ -16,7 +16,7 @@ // error-pattern:so long fn main() { let mut x = Vec::new(); - let y = vec!(3); + let y = vec!(3i); fail!("so long"); x.push_all_move(y); } diff --git a/src/test/run-fail/mod-zero.rs b/src/test/run-fail/mod-zero.rs index 76d4de7ecb03c..544150517084c 100644 --- a/src/test/run-fail/mod-zero.rs +++ b/src/test/run-fail/mod-zero.rs @@ -10,6 +10,6 @@ // error-pattern:attempted remainder with a divisor of zero fn main() { - let y = 0; - let _z = 1 % y; + let y = 0i; + let _z = 1i % y; } diff --git a/src/test/run-fail/unwind-assert.rs b/src/test/run-fail/unwind-assert.rs index 2f6bd9ad255e0..c4dd8802d8a84 100644 --- a/src/test/run-fail/unwind-assert.rs +++ b/src/test/run-fail/unwind-assert.rs @@ -15,6 +15,6 @@ use std::gc::GC; fn main() { - let _a = box(GC) 0; + let _a = box(GC) 0i; assert!(false); } diff --git a/src/test/run-fail/unwind-box-res.rs b/src/test/run-fail/unwind-box-res.rs index c370846c673db..f80f25ec6ebc2 100644 --- a/src/test/run-fail/unwind-box-res.rs +++ b/src/test/run-fail/unwind-box-res.rs @@ -41,7 +41,7 @@ fn r(v: *const int) -> r { fn main() { unsafe { - let i1 = box 0; + let i1 = box 0i; let i1p = mem::transmute_copy(&i1); mem::forget(i1); let x = box(GC) r(i1p); diff --git a/src/test/run-fail/unwind-box.rs b/src/test/run-fail/unwind-box.rs index e31f66ed9fb08..3647c553bf218 100644 --- a/src/test/run-fail/unwind-box.rs +++ b/src/test/run-fail/unwind-box.rs @@ -19,6 +19,6 @@ fn failfn() { } fn main() { - box(GC) 0; + box(GC) 0i; failfn(); } diff --git a/src/test/run-fail/unwind-fail.rs b/src/test/run-fail/unwind-fail.rs index 5dbfd73c1d7e7..e25fe1908ba53 100644 --- a/src/test/run-fail/unwind-fail.rs +++ b/src/test/run-fail/unwind-fail.rs @@ -15,6 +15,6 @@ use std::gc::GC; fn main() { - box(GC) 0; + box(GC) 0i; fail!(); } diff --git a/src/test/run-fail/unwind-interleaved.rs b/src/test/run-fail/unwind-interleaved.rs index 6f2400ec4f0e4..f6a3aa48def9b 100644 --- a/src/test/run-fail/unwind-interleaved.rs +++ b/src/test/run-fail/unwind-interleaved.rs @@ -15,8 +15,8 @@ fn a() { } fn b() { fail!(); } fn main() { - let _x = vec!(0); + let _x = vec!(0i); a(); - let _y = vec!(0); + let _y = vec!(0i); b(); } diff --git a/src/test/run-fail/unwind-iter.rs b/src/test/run-fail/unwind-iter.rs index 8671758c42307..d77a9f911b5ef 100644 --- a/src/test/run-fail/unwind-iter.rs +++ b/src/test/run-fail/unwind-iter.rs @@ -22,6 +22,6 @@ fn x(it: |int|) { } fn main() { - let a = box(GC) 0; + let a = box(GC) 0i; x(|_i| { } ); } diff --git a/src/test/run-fail/unwind-iter2.rs b/src/test/run-fail/unwind-iter2.rs index d7b950ad5c19f..9f00c0bc8bace 100644 --- a/src/test/run-fail/unwind-iter2.rs +++ b/src/test/run-fail/unwind-iter2.rs @@ -15,7 +15,7 @@ use std::gc::{GC}; fn x(it: |int|) { - let _a = box(GC) 0; + let _a = box(GC) 0i; it(1); } diff --git a/src/test/run-fail/unwind-match.rs b/src/test/run-fail/unwind-match.rs index 4f1e454c39e3f..f256884b312a7 100644 --- a/src/test/run-fail/unwind-match.rs +++ b/src/test/run-fail/unwind-match.rs @@ -16,7 +16,7 @@ use std::gc::GC; fn test_box() { - box(GC) 0; + box(GC) 0i; } fn test_str() { let res = match false { true => { "happy".to_string() }, diff --git a/src/test/run-fail/unwind-nested.rs b/src/test/run-fail/unwind-nested.rs index b7a12f08c410e..bebf06cf45aeb 100644 --- a/src/test/run-fail/unwind-nested.rs +++ b/src/test/run-fail/unwind-nested.rs @@ -15,9 +15,9 @@ use std::gc::GC; fn main() { - let _a = box(GC) 0; + let _a = box(GC) 0i; { - let _b = box(GC) 0; + let _b = box(GC) 0i; { fail!(); } diff --git a/src/test/run-fail/unwind-partial-box.rs b/src/test/run-fail/unwind-partial-box.rs index 2bd264d0e3365..5912f8167bc49 100644 --- a/src/test/run-fail/unwind-partial-box.rs +++ b/src/test/run-fail/unwind-partial-box.rs @@ -19,7 +19,7 @@ fn f() -> Vec { fail!(); } // Voodoo. In unwind-alt we had to do this to trigger the bug. Might // have been to do with memory allocation patterns. fn prime() { - box(GC) 0; + box(GC) 0i; } fn partial() { diff --git a/src/test/run-fail/unwind-partial-unique.rs b/src/test/run-fail/unwind-partial-unique.rs index 4ea099e9c0f36..2e6eee6573892 100644 --- a/src/test/run-fail/unwind-partial-unique.rs +++ b/src/test/run-fail/unwind-partial-unique.rs @@ -19,7 +19,7 @@ fn f() -> Vec { fail!(); } // Voodoo. In unwind-alt we had to do this to trigger the bug. Might // have been to do with memory allocation patterns. fn prime() { - box(GC) 0; + box(GC) 0i; } fn partial() { diff --git a/src/test/run-fail/unwind-partial-vec.rs b/src/test/run-fail/unwind-partial-vec.rs index e0e043f623ba6..7ad02fcd3d753 100644 --- a/src/test/run-fail/unwind-partial-vec.rs +++ b/src/test/run-fail/unwind-partial-vec.rs @@ -19,11 +19,11 @@ fn f() -> Vec { fail!(); } // Voodoo. In unwind-alt we had to do this to trigger the bug. Might // have been to do with memory allocation patterns. fn prime() { - box(GC) 0; + box(GC) 0i; } fn partial() { - let _x = vec!(vec!(0), f(), vec!(0)); + let _x = vec!(vec!(0i), f(), vec!(0i)); } fn main() { diff --git a/src/test/run-fail/unwind-resource-fail.rs b/src/test/run-fail/unwind-resource-fail.rs index 498d3ee6b0bc1..8d0a14306d990 100644 --- a/src/test/run-fail/unwind-resource-fail.rs +++ b/src/test/run-fail/unwind-resource-fail.rs @@ -25,6 +25,6 @@ impl Drop for r { fn r(i: int) -> r { r { i: i } } fn main() { - box(GC) 0; + box(GC) 0i; let _r = r(0); } diff --git a/src/test/run-fail/unwind-stacked.rs b/src/test/run-fail/unwind-stacked.rs index da6205e9e3734..97f4d974d8dd6 100644 --- a/src/test/run-fail/unwind-stacked.rs +++ b/src/test/run-fail/unwind-stacked.rs @@ -15,16 +15,16 @@ use std::gc::GC; fn f() { - let _a = box(GC) 0; + let _a = box(GC) 0i; fail!(); } fn g() { - let _b = box(GC) 0; + let _b = box(GC) 0i; f(); } fn main() { - let _a = box(GC) 0; + let _a = box(GC) 0i; g(); } diff --git a/src/test/run-fail/unwind-tup.rs b/src/test/run-fail/unwind-tup.rs index 08a22a7c355b7..4a7914c568aca 100644 --- a/src/test/run-fail/unwind-tup.rs +++ b/src/test/run-fail/unwind-tup.rs @@ -19,5 +19,5 @@ fn fold_local() -> Gc> { } fn main() { - let _lss = (fold_local(), 0); + let _lss = (fold_local(), 0i); } diff --git a/src/test/run-fail/unwind-uninitialized.rs b/src/test/run-fail/unwind-uninitialized.rs index acba93f7be3ba..29723b1272901 100644 --- a/src/test/run-fail/unwind-uninitialized.rs +++ b/src/test/run-fail/unwind-uninitialized.rs @@ -20,5 +20,5 @@ fn f() { fn main() { f(); - let _a = box(GC) 0; + let _a = box(GC) 0i; } diff --git a/src/test/run-fail/unwind-unique.rs b/src/test/run-fail/unwind-unique.rs index af1e499d1f203..233d367c4b1e1 100644 --- a/src/test/run-fail/unwind-unique.rs +++ b/src/test/run-fail/unwind-unique.rs @@ -16,6 +16,6 @@ fn failfn() { } fn main() { - box 0; + box 0i; failfn(); } diff --git a/src/test/run-make/graphviz-flowgraph/f01.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f01.dot-expected.dot index 9d8411cfc58df..a5239a6cc665b 100644 --- a/src/test/run-make/graphviz-flowgraph/f01.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f01.dot-expected.dot @@ -1,8 +1,8 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 1"]; - N3[label="block { 1; }"]; + N2[label="expr 1i"]; + N3[label="block { 1i; }"]; N0 -> N2; N2 -> N3; N3 -> N1; diff --git a/src/test/run-make/graphviz-flowgraph/f01.rs b/src/test/run-make/graphviz-flowgraph/f01.rs index 231aab69e50d9..f1f1a1d5472f7 100644 --- a/src/test/run-make/graphviz-flowgraph/f01.rs +++ b/src/test/run-make/graphviz-flowgraph/f01.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn lit_1() { - 1; + 1i; } diff --git a/src/test/run-make/graphviz-flowgraph/f03.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f03.dot-expected.dot index aff430459e872..43462862f6ea9 100644 --- a/src/test/run-make/graphviz-flowgraph/f03.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f03.dot-expected.dot @@ -1,10 +1,10 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 3"]; - N3[label="expr 33"]; - N4[label="expr 3 + 33"]; - N5[label="block { 3 + 33; }"]; + N2[label="expr 3i"]; + N3[label="expr 33i"]; + N4[label="expr 3i + 33i"]; + N5[label="block { 3i + 33i; }"]; N0 -> N2; N2 -> N3; N3 -> N4; diff --git a/src/test/run-make/graphviz-flowgraph/f03.rs b/src/test/run-make/graphviz-flowgraph/f03.rs index 8b172c0a10512..1007225f2f291 100644 --- a/src/test/run-make/graphviz-flowgraph/f03.rs +++ b/src/test/run-make/graphviz-flowgraph/f03.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn expr_add_3() { - 3 + 33; + 3i + 33i; } diff --git a/src/test/run-make/graphviz-flowgraph/f04.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f04.dot-expected.dot index adcc582c73387..26c858a0828ca 100644 --- a/src/test/run-make/graphviz-flowgraph/f04.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f04.dot-expected.dot @@ -1,9 +1,9 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 4"]; + N2[label="expr 4i"]; N3[label="local _x"]; - N4[label="block { let _x = 4; }"]; + N4[label="block { let _x = 4i; }"]; N0 -> N2; N2 -> N3; N3 -> N4; diff --git a/src/test/run-make/graphviz-flowgraph/f04.rs b/src/test/run-make/graphviz-flowgraph/f04.rs index 2a0ac8ac9e570..ed2f7e25dae6c 100644 --- a/src/test/run-make/graphviz-flowgraph/f04.rs +++ b/src/test/run-make/graphviz-flowgraph/f04.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn pat_id_4() { - let _x = 4; + let _x = 4i; } diff --git a/src/test/run-make/graphviz-flowgraph/f05.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f05.dot-expected.dot index 2d52c14da6246..850d04f430f0d 100644 --- a/src/test/run-make/graphviz-flowgraph/f05.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f05.dot-expected.dot @@ -1,13 +1,13 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 5"]; - N3[label="expr 55"]; - N4[label="expr (5, 55)"]; + N2[label="expr 5i"]; + N3[label="expr 55i"]; + N4[label="expr (5i, 55i)"]; N5[label="local _x"]; N6[label="local _y"]; N7[label="pat (_x, _y)"]; - N8[label="block { let (_x, _y) = (5, 55); }"]; + N8[label="block { let (_x, _y) = (5i, 55i); }"]; N0 -> N2; N2 -> N3; N3 -> N4; diff --git a/src/test/run-make/graphviz-flowgraph/f05.rs b/src/test/run-make/graphviz-flowgraph/f05.rs index 616d822bed07b..b2591bdd08a16 100644 --- a/src/test/run-make/graphviz-flowgraph/f05.rs +++ b/src/test/run-make/graphviz-flowgraph/f05.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn pat_tup_5() { - let (_x, _y) = (5, 55); + let (_x, _y) = (5i, 55i); } diff --git a/src/test/run-make/graphviz-flowgraph/f07.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f07.dot-expected.dot index c99af1791495f..251798fc7ed88 100644 --- a/src/test/run-make/graphviz-flowgraph/f07.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f07.dot-expected.dot @@ -1,12 +1,12 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 7"]; - N3[label="expr 77"]; - N4[label="expr 777"]; - N5[label="expr 7777"]; - N6[label="expr [7, 77, 777, 7777]"]; - N7[label="expr match [7, 77, 777, 7777] { [x, y, ..] => x + y }"]; + N2[label="expr 7i"]; + N3[label="expr 77i"]; + N4[label="expr 777i"]; + N5[label="expr 7777i"]; + N6[label="expr [7i, 77i, 777i, 7777i]"]; + N7[label="expr match [7i, 77i, 777i, 7777i] { [x, y, ..] => x + y }"]; N8[label="local x"]; N9[label="local y"]; N10[label="pat .."]; @@ -14,7 +14,7 @@ digraph block { N12[label="expr x"]; N13[label="expr y"]; N14[label="expr x + y"]; - N15[label="block { match [7, 77, 777, 7777] { [x, y, ..] => x + y }; }"]; + N15[label="block { match [7i, 77i, 777i, 7777i] { [x, y, ..] => x + y }; }"]; N0 -> N2; N2 -> N3; N3 -> N4; diff --git a/src/test/run-make/graphviz-flowgraph/f07.rs b/src/test/run-make/graphviz-flowgraph/f07.rs index 39f71d309fdf9..fb3f2d24cddc7 100644 --- a/src/test/run-make/graphviz-flowgraph/f07.rs +++ b/src/test/run-make/graphviz-flowgraph/f07.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn pat_vec_7() { - match [7, 77, 777, 7777] { + match [7i, 77i, 777i, 7777i] { [x, y, ..] => x + y }; } diff --git a/src/test/run-make/graphviz-flowgraph/f08.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f08.dot-expected.dot index 61a708cd9ccd4..f43beb025e345 100644 --- a/src/test/run-make/graphviz-flowgraph/f08.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f08.dot-expected.dot @@ -1,18 +1,18 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 8"]; + N2[label="expr 8i"]; N3[label="local x"]; N4[label="local _y"]; N5[label="expr x"]; - N6[label="expr 88"]; - N7[label="expr x > 88"]; - N8[label="expr 888"]; + N6[label="expr 88i"]; + N7[label="expr x > 88i"]; + N8[label="expr 888i"]; N9[label="expr _y"]; - N10[label="expr _y = 888"]; - N11[label="block { _y = 888; }"]; - N12[label="expr if x > 88 { _y = 888; }"]; - N13[label="block { let x = 8; let _y; if x > 88 { _y = 888; } }"]; + N10[label="expr _y = 888i"]; + N11[label="block { _y = 888i; }"]; + N12[label="expr if x > 88i { _y = 888i; }"]; + N13[label="block { let x = 8i; let _y; if x > 88i { _y = 888i; } }"]; N0 -> N2; N2 -> N3; N3 -> N4; diff --git a/src/test/run-make/graphviz-flowgraph/f08.rs b/src/test/run-make/graphviz-flowgraph/f08.rs index 6ba7b03d54da5..5d166e5ffcd5d 100644 --- a/src/test/run-make/graphviz-flowgraph/f08.rs +++ b/src/test/run-make/graphviz-flowgraph/f08.rs @@ -9,8 +9,8 @@ // except according to those terms. pub fn expr_if_onearm_8() { - let x = 8; let _y; - if x > 88 { - _y = 888; + let x = 8i; let _y; + if x > 88i { + _y = 888i; } } diff --git a/src/test/run-make/graphviz-flowgraph/f09.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f09.dot-expected.dot index 892b9fcd841f8..a3576b9c36b69 100644 --- a/src/test/run-make/graphviz-flowgraph/f09.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f09.dot-expected.dot @@ -1,25 +1,25 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 91"]; + N2[label="expr 91i"]; N3[label="local x"]; N4[label="local _y"]; N5[label="expr x"]; - N6[label="expr 92"]; - N7[label="expr x > 92"]; - N8[label="expr 93"]; + N6[label="expr 92i"]; + N7[label="expr x > 92i"]; + N8[label="expr 93i"]; N9[label="expr _y"]; - N10[label="expr _y = 93"]; - N11[label="block { _y = 93; }"]; - N12[label="expr 94"]; - N13[label="expr 95"]; - N14[label="expr 94 + 95"]; + N10[label="expr _y = 93i"]; + N11[label="block { _y = 93i; }"]; + N12[label="expr 94i"]; + N13[label="expr 95i"]; + N14[label="expr 94i + 95i"]; N15[label="expr _y"]; - N16[label="expr _y = 94 + 95"]; - N17[label="block { _y = 94 + 95; }"]; - N18[label="expr { _y = 94 + 95; }"]; - N19[label="expr if x > 92 { _y = 93; } else { _y = 94 + 95; }"]; - N20[label="block { let x = 91; let _y; if x > 92 { _y = 93; } else { _y = 94 + 95; } }"]; + N16[label="expr _y = 94i + 95i"]; + N17[label="block { _y = 94i + 95i; }"]; + N18[label="expr { _y = 94i + 95i; }"]; + N19[label="expr if x > 92i { _y = 93i; } else { _y = 94i + 95i; }"]; + N20[label="block { let x = 91i; let _y; if x > 92i { _y = 93i; } else { _y = 94i + 95i; } }"]; N0 -> N2; N2 -> N3; N3 -> N4; diff --git a/src/test/run-make/graphviz-flowgraph/f09.rs b/src/test/run-make/graphviz-flowgraph/f09.rs index a78ccb8a93741..cfe5f4f37d60f 100644 --- a/src/test/run-make/graphviz-flowgraph/f09.rs +++ b/src/test/run-make/graphviz-flowgraph/f09.rs @@ -9,10 +9,10 @@ // except according to those terms. pub fn expr_if_twoarm_9() { - let x = 91; let _y; - if x > 92 { - _y = 93; + let x = 91i; let _y; + if x > 92i { + _y = 93i; } else { - _y = 94+95; + _y = 94i+95i; } } diff --git a/src/test/run-make/graphviz-flowgraph/f10.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f10.dot-expected.dot index 2cef122104eda..69b5bd6f58cdf 100644 --- a/src/test/run-make/graphviz-flowgraph/f10.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f10.dot-expected.dot @@ -1,18 +1,18 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 10"]; + N2[label="expr 10i"]; N3[label="local mut x"]; N4[label="(dummy_node)"]; N5[label="expr x"]; - N6[label="expr 0"]; - N7[label="expr x > 0"]; - N8[label="expr while x > 0 { x -= 1; }"]; - N9[label="expr 1"]; + N6[label="expr 0i"]; + N7[label="expr x > 0i"]; + N8[label="expr while x > 0i { x -= 1i; }"]; + N9[label="expr 1i"]; N10[label="expr x"]; - N11[label="expr x -= 1"]; - N12[label="block { x -= 1; }"]; - N13[label="block { let mut x = 10; while x > 0 { x -= 1; } }"]; + N11[label="expr x -= 1i"]; + N12[label="block { x -= 1i; }"]; + N13[label="block { let mut x = 10i; while x > 0i { x -= 1i; } }"]; N0 -> N2; N2 -> N3; N3 -> N4; diff --git a/src/test/run-make/graphviz-flowgraph/f10.rs b/src/test/run-make/graphviz-flowgraph/f10.rs index 0ca7cc5ee86bd..af263f0cf10db 100644 --- a/src/test/run-make/graphviz-flowgraph/f10.rs +++ b/src/test/run-make/graphviz-flowgraph/f10.rs @@ -9,8 +9,8 @@ // except according to those terms. pub fn expr_while_10() { - let mut x = 10; - while x > 0 { - x -= 1; + let mut x = 10i; + while x > 0i { + x -= 1i; } } diff --git a/src/test/run-make/graphviz-flowgraph/f11.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f11.dot-expected.dot index 59d65e5b8b7fc..44024cf76f31a 100644 --- a/src/test/run-make/graphviz-flowgraph/f11.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f11.dot-expected.dot @@ -1,16 +1,16 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 11"]; + N2[label="expr 11i"]; N3[label="local mut _x"]; N4[label="(dummy_node)"]; - N5[label="expr loop { _x -= 1; }"]; - N6[label="expr 1"]; + N5[label="expr loop { _x -= 1i; }"]; + N6[label="expr 1i"]; N7[label="expr _x"]; - N8[label="expr _x -= 1"]; - N9[label="block { _x -= 1; }"]; + N8[label="expr _x -= 1i"]; + N9[label="block { _x -= 1i; }"]; N10[label="expr \"unreachable\""]; - N11[label="block { let mut _x = 11; loop { _x -= 1; } \"unreachable\"; }"]; + N11[label="block { let mut _x = 11i; loop { _x -= 1i; } \"unreachable\"; }"]; N0 -> N2; N2 -> N3; N3 -> N4; diff --git a/src/test/run-make/graphviz-flowgraph/f11.rs b/src/test/run-make/graphviz-flowgraph/f11.rs index d0f3452119e16..95260c608eca4 100644 --- a/src/test/run-make/graphviz-flowgraph/f11.rs +++ b/src/test/run-make/graphviz-flowgraph/f11.rs @@ -10,9 +10,9 @@ #[allow(unreachable_code)] pub fn expr_loop_11() { - let mut _x = 11; + let mut _x = 11i; loop { - _x -= 1; + _x -= 1i; } "unreachable"; } diff --git a/src/test/run-make/graphviz-flowgraph/f12.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f12.dot-expected.dot index 9c0f25d5bece5..ad257c19741b3 100644 --- a/src/test/run-make/graphviz-flowgraph/f12.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f12.dot-expected.dot @@ -1,23 +1,23 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 12"]; + N2[label="expr 12i"]; N3[label="local mut x"]; N4[label="(dummy_node)"]; - N5[label="expr loop { x -= 1; if x == 2 { break ; \"unreachable\"; } }"]; - N6[label="expr 1"]; + N5[label="expr loop { x -= 1i; if x == 2i { break ; \"unreachable\"; } }"]; + N6[label="expr 1i"]; N7[label="expr x"]; - N8[label="expr x -= 1"]; + N8[label="expr x -= 1i"]; N9[label="expr x"]; - N10[label="expr 2"]; - N11[label="expr x == 2"]; + N10[label="expr 2i"]; + N11[label="expr x == 2i"]; N12[label="expr break"]; N13[label="(dummy_node)"]; N14[label="expr \"unreachable\""]; N15[label="block { break ; \"unreachable\"; }"]; - N16[label="expr if x == 2 { break ; \"unreachable\"; }"]; - N17[label="block { x -= 1; if x == 2 { break ; \"unreachable\"; } }"]; - N18[label="block { let mut x = 12; loop { x -= 1; if x == 2 { break ; \"unreachable\"; } } }"]; + N16[label="expr if x == 2i { break ; \"unreachable\"; }"]; + N17[label="block { x -= 1i; if x == 2i { break ; \"unreachable\"; } }"]; + N18[label="block { let mut x = 12i; loop { x -= 1i; if x == 2i { break ; \"unreachable\"; } } }"]; N0 -> N2; N2 -> N3; N3 -> N4; @@ -28,7 +28,7 @@ digraph block { N9 -> N10; N10 -> N11; N11 -> N12; - N12 -> N5[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if x == 2 { break ; \"unreachable\"; },\lexiting scope_4 block { x -= 1; if x == 2 { break ; \"unreachable\"; } }"]; + N12 -> N5[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if x == 2i { break ; \"unreachable\"; },\lexiting scope_4 block { x -= 1i; if x == 2i { break ; \"unreachable\"; } }"]; N13 -> N14; N14 -> N15; N11 -> N16; diff --git a/src/test/run-make/graphviz-flowgraph/f12.rs b/src/test/run-make/graphviz-flowgraph/f12.rs index 90b146340b6f5..625dd8cb03ef9 100644 --- a/src/test/run-make/graphviz-flowgraph/f12.rs +++ b/src/test/run-make/graphviz-flowgraph/f12.rs @@ -10,9 +10,9 @@ #[allow(unreachable_code)] pub fn expr_loop_12() { - let mut x = 12; + let mut x = 12i; loop { - x -= 1; - if x == 2 { break; "unreachable"; } + x -= 1i; + if x == 2i { break; "unreachable"; } } } diff --git a/src/test/run-make/graphviz-flowgraph/f14.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f14.dot-expected.dot index 0fa4e9b44de34..f8e4bd12bb031 100644 --- a/src/test/run-make/graphviz-flowgraph/f14.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f14.dot-expected.dot @@ -1,17 +1,17 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 14"]; + N2[label="expr 14i"]; N3[label="local x"]; N4[label="expr x"]; - N5[label="expr 1"]; - N6[label="expr x > 1"]; + N5[label="expr 1i"]; + N6[label="expr x > 1i"]; N7[label="expr return"]; N8[label="(dummy_node)"]; N9[label="expr \"unreachable\""]; N10[label="block { return; \"unreachable\"; }"]; - N11[label="expr if x > 1 { return; \"unreachable\"; }"]; - N12[label="block { let x = 14; if x > 1 { return; \"unreachable\"; } }"]; + N11[label="expr if x > 1i { return; \"unreachable\"; }"]; + N12[label="block { let x = 14i; if x > 1i { return; \"unreachable\"; } }"]; N0 -> N2; N2 -> N3; N3 -> N4; diff --git a/src/test/run-make/graphviz-flowgraph/f14.rs b/src/test/run-make/graphviz-flowgraph/f14.rs index 98ff095c8317c..72616f3159487 100644 --- a/src/test/run-make/graphviz-flowgraph/f14.rs +++ b/src/test/run-make/graphviz-flowgraph/f14.rs @@ -10,8 +10,8 @@ #[allow(unreachable_code)] pub fn expr_ret_14() { - let x = 14; - if x > 1 { + let x = 14i; + if x > 1i { return; "unreachable"; } diff --git a/src/test/run-make/graphviz-flowgraph/f15.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f15.dot-expected.dot index f0278fba311e6..bc47d9aff8121 100644 --- a/src/test/run-make/graphviz-flowgraph/f15.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f15.dot-expected.dot @@ -1,42 +1,42 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 15"]; + N2[label="expr 15i"]; N3[label="local mut x"]; - N4[label="expr 151"]; + N4[label="expr 151i"]; N5[label="local mut y"]; N6[label="(dummy_node)"]; - N7[label="expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\" }\l if y >= 2 { break ; \"unreachable\" }\l y -= 3;\l }\l y -= 4;\l x -= 5;\l }\l"]; + N7[label="expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\" }\l if y >= 2i { break ; \"unreachable\" }\l y -= 3i;\l }\l y -= 4i;\l x -= 5i;\l }\l"]; N8[label="(dummy_node)"]; - N9[label="expr \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\" }\l if y >= 2 { break ; \"unreachable\" }\l y -= 3;\l }\l"]; + N9[label="expr \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\" }\l if y >= 2i { break ; \"unreachable\" }\l y -= 3i;\l }\l"]; N10[label="expr x"]; - N11[label="expr 1"]; - N12[label="expr x == 1"]; + N11[label="expr 1i"]; + N12[label="expr x == 1i"]; N13[label="expr break \'outer"]; N14[label="(dummy_node)"]; N15[label="expr \"unreachable\""]; N16[label="block { break \'outer ; \"unreachable\" }"]; - N17[label="expr if x == 1 { break \'outer ; \"unreachable\" }"]; + N17[label="expr if x == 1i { break \'outer ; \"unreachable\" }"]; N18[label="expr y"]; - N19[label="expr 2"]; - N20[label="expr y >= 2"]; + N19[label="expr 2i"]; + N20[label="expr y >= 2i"]; N21[label="expr break"]; N22[label="(dummy_node)"]; N23[label="expr \"unreachable\""]; N24[label="block { break ; \"unreachable\" }"]; - N25[label="expr if y >= 2 { break ; \"unreachable\" }"]; - N26[label="expr 3"]; + N25[label="expr if y >= 2i { break ; \"unreachable\" }"]; + N26[label="expr 3i"]; N27[label="expr y"]; - N28[label="expr y -= 3"]; - N29[label="block {\l if x == 1 { break \'outer ; \"unreachable\" }\l if y >= 2 { break ; \"unreachable\" }\l y -= 3;\l}\l"]; - N30[label="expr 4"]; + N28[label="expr y -= 3i"]; + N29[label="block {\l if x == 1i { break \'outer ; \"unreachable\" }\l if y >= 2i { break ; \"unreachable\" }\l y -= 3i;\l}\l"]; + N30[label="expr 4i"]; N31[label="expr y"]; - N32[label="expr y -= 4"]; - N33[label="expr 5"]; + N32[label="expr y -= 4i"]; + N33[label="expr 5i"]; N34[label="expr x"]; - N35[label="expr x -= 5"]; - N36[label="block {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\" }\l if y >= 2 { break ; \"unreachable\" }\l y -= 3;\l }\l y -= 4;\l x -= 5;\l}\l"]; - N37[label="block {\l let mut x = 15;\l let mut y = 151;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\" }\l if y >= 2 { break ; \"unreachable\" }\l y -= 3;\l }\l y -= 4;\l x -= 5;\l }\l}\l"]; + N35[label="expr x -= 5i"]; + N36[label="block {\l \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\" }\l if y >= 2i { break ; \"unreachable\" }\l y -= 3i;\l }\l y -= 4i;\l x -= 5i;\l}\l"]; + N37[label="block {\l let mut x = 15i;\l let mut y = 151i;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\" }\l if y >= 2i { break ; \"unreachable\" }\l y -= 3i;\l }\l y -= 4i;\l x -= 5i;\l }\l}\l"]; N0 -> N2; N2 -> N3; N3 -> N4; @@ -47,7 +47,7 @@ digraph block { N10 -> N11; N11 -> N12; N12 -> N13; - N13 -> N7[label="exiting scope_0 expr break \'outer,\lexiting scope_1 stmt break \'outer ;,\lexiting scope_2 block { break \'outer ; \"unreachable\" },\lexiting scope_3 expr if x == 1 { break \'outer ; \"unreachable\" },\lexiting scope_4 stmt if x == 1 { break \'outer ; \"unreachable\" },\lexiting scope_5 block {\l if x == 1 { break \'outer ; \"unreachable\" }\l if y >= 2 { break ; \"unreachable\" }\l y -= 3;\l}\l,\lexiting scope_6 expr \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\" }\l if y >= 2 { break ; \"unreachable\" }\l y -= 3;\l }\l,\lexiting scope_7 stmt \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\" }\l if y >= 2 { break ; \"unreachable\" }\l y -= 3;\l }\l,\lexiting scope_8 block {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\" }\l if y >= 2 { break ; \"unreachable\" }\l y -= 3;\l }\l y -= 4;\l x -= 5;\l}\l"]; + N13 -> N7[label="exiting scope_0 expr break \'outer,\lexiting scope_1 stmt break \'outer ;,\lexiting scope_2 block { break \'outer ; \"unreachable\" },\lexiting scope_3 expr if x == 1i { break \'outer ; \"unreachable\" },\lexiting scope_4 stmt if x == 1i { break \'outer ; \"unreachable\" },\lexiting scope_5 block {\l if x == 1i { break \'outer ; \"unreachable\" }\l if y >= 2i { break ; \"unreachable\" }\l y -= 3i;\l}\l,\lexiting scope_6 expr \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\" }\l if y >= 2i { break ; \"unreachable\" }\l y -= 3i;\l }\l,\lexiting scope_7 stmt \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\" }\l if y >= 2i { break ; \"unreachable\" }\l y -= 3i;\l }\l,\lexiting scope_8 block {\l \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\" }\l if y >= 2i { break ; \"unreachable\" }\l y -= 3i;\l }\l y -= 4i;\l x -= 5i;\l}\l"]; N14 -> N15; N15 -> N16; N12 -> N17; @@ -56,7 +56,7 @@ digraph block { N18 -> N19; N19 -> N20; N20 -> N21; - N21 -> N9[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\" },\lexiting scope_3 expr if y >= 2 { break ; \"unreachable\" },\lexiting scope_4 stmt if y >= 2 { break ; \"unreachable\" },\lexiting scope_5 block {\l if x == 1 { break \'outer ; \"unreachable\" }\l if y >= 2 { break ; \"unreachable\" }\l y -= 3;\l}\l"]; + N21 -> N9[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\" },\lexiting scope_3 expr if y >= 2i { break ; \"unreachable\" },\lexiting scope_4 stmt if y >= 2i { break ; \"unreachable\" },\lexiting scope_5 block {\l if x == 1i { break \'outer ; \"unreachable\" }\l if y >= 2i { break ; \"unreachable\" }\l y -= 3i;\l}\l"]; N22 -> N23; N23 -> N24; N20 -> N25; diff --git a/src/test/run-make/graphviz-flowgraph/f15.rs b/src/test/run-make/graphviz-flowgraph/f15.rs index 44c038d643bad..e5ca1de3f2d2c 100644 --- a/src/test/run-make/graphviz-flowgraph/f15.rs +++ b/src/test/run-make/graphviz-flowgraph/f15.rs @@ -10,21 +10,21 @@ #[allow(unreachable_code)] pub fn expr_break_label_15() { - let mut x = 15; - let mut y = 151; + let mut x = 15i; + let mut y = 151i; 'outer: loop { 'inner: loop { - if x == 1 { + if x == 1i { break 'outer; "unreachable" } - if y >= 2 { + if y >= 2i { break; "unreachable" } - y -= 3; + y -= 3i; } - y -= 4; - x -= 5; + y -= 4i; + x -= 5i; } } diff --git a/src/test/run-make/graphviz-flowgraph/f16.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f16.dot-expected.dot index 3f999ae378142..9c60e19f8b073 100644 --- a/src/test/run-make/graphviz-flowgraph/f16.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f16.dot-expected.dot @@ -1,43 +1,43 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 16"]; + N2[label="expr 16i"]; N3[label="local mut x"]; - N4[label="expr 16"]; + N4[label="expr 16i"]; N5[label="local mut y"]; N6[label="(dummy_node)"]; - N7[label="expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\" }\l if y >= 1 { break ; \"unreachable\" }\l y -= 1;\l }\l y -= 1;\l x -= 1;\l }\l"]; + N7[label="expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\" }\l if y >= 1i { break ; \"unreachable\" }\l y -= 1i;\l }\l y -= 1i;\l x -= 1i;\l }\l"]; N8[label="(dummy_node)"]; - N9[label="expr \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\" }\l if y >= 1 { break ; \"unreachable\" }\l y -= 1;\l }\l"]; + N9[label="expr \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\" }\l if y >= 1i { break ; \"unreachable\" }\l y -= 1i;\l }\l"]; N10[label="expr x"]; - N11[label="expr 1"]; - N12[label="expr x == 1"]; + N11[label="expr 1i"]; + N12[label="expr x == 1i"]; N13[label="expr continue \'outer"]; N14[label="(dummy_node)"]; N15[label="expr \"unreachable\""]; N16[label="block { continue \'outer ; \"unreachable\" }"]; - N17[label="expr if x == 1 { continue \'outer ; \"unreachable\" }"]; + N17[label="expr if x == 1i { continue \'outer ; \"unreachable\" }"]; N18[label="expr y"]; - N19[label="expr 1"]; - N20[label="expr y >= 1"]; + N19[label="expr 1i"]; + N20[label="expr y >= 1i"]; N21[label="expr break"]; N22[label="(dummy_node)"]; N23[label="expr \"unreachable\""]; N24[label="block { break ; \"unreachable\" }"]; - N25[label="expr if y >= 1 { break ; \"unreachable\" }"]; - N26[label="expr 1"]; + N25[label="expr if y >= 1i { break ; \"unreachable\" }"]; + N26[label="expr 1i"]; N27[label="expr y"]; - N28[label="expr y -= 1"]; - N29[label="block {\l if x == 1 { continue \'outer ; \"unreachable\" }\l if y >= 1 { break ; \"unreachable\" }\l y -= 1;\l}\l"]; - N30[label="expr 1"]; + N28[label="expr y -= 1i"]; + N29[label="block {\l if x == 1i { continue \'outer ; \"unreachable\" }\l if y >= 1i { break ; \"unreachable\" }\l y -= 1i;\l}\l"]; + N30[label="expr 1i"]; N31[label="expr y"]; - N32[label="expr y -= 1"]; - N33[label="expr 1"]; + N32[label="expr y -= 1i"]; + N33[label="expr 1i"]; N34[label="expr x"]; - N35[label="expr x -= 1"]; - N36[label="block {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\" }\l if y >= 1 { break ; \"unreachable\" }\l y -= 1;\l }\l y -= 1;\l x -= 1;\l}\l"]; + N35[label="expr x -= 1i"]; + N36[label="block {\l \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\" }\l if y >= 1i { break ; \"unreachable\" }\l y -= 1i;\l }\l y -= 1i;\l x -= 1i;\l}\l"]; N37[label="expr \"unreachable\""]; - N38[label="block {\l let mut x = 16;\l let mut y = 16;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\" }\l if y >= 1 { break ; \"unreachable\" }\l y -= 1;\l }\l y -= 1;\l x -= 1;\l }\l \"unreachable\";\l}\l"]; + N38[label="block {\l let mut x = 16i;\l let mut y = 16i;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\" }\l if y >= 1i { break ; \"unreachable\" }\l y -= 1i;\l }\l y -= 1i;\l x -= 1i;\l }\l \"unreachable\";\l}\l"]; N0 -> N2; N2 -> N3; N3 -> N4; @@ -48,7 +48,7 @@ digraph block { N10 -> N11; N11 -> N12; N12 -> N13; - N13 -> N6[label="exiting scope_0 expr continue \'outer,\lexiting scope_1 stmt continue \'outer ;,\lexiting scope_2 block { continue \'outer ; \"unreachable\" },\lexiting scope_3 expr if x == 1 { continue \'outer ; \"unreachable\" },\lexiting scope_4 stmt if x == 1 { continue \'outer ; \"unreachable\" },\lexiting scope_5 block {\l if x == 1 { continue \'outer ; \"unreachable\" }\l if y >= 1 { break ; \"unreachable\" }\l y -= 1;\l}\l,\lexiting scope_6 expr \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\" }\l if y >= 1 { break ; \"unreachable\" }\l y -= 1;\l }\l,\lexiting scope_7 stmt \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\" }\l if y >= 1 { break ; \"unreachable\" }\l y -= 1;\l }\l,\lexiting scope_8 block {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\" }\l if y >= 1 { break ; \"unreachable\" }\l y -= 1;\l }\l y -= 1;\l x -= 1;\l}\l"]; + N13 -> N6[label="exiting scope_0 expr continue \'outer,\lexiting scope_1 stmt continue \'outer ;,\lexiting scope_2 block { continue \'outer ; \"unreachable\" },\lexiting scope_3 expr if x == 1i { continue \'outer ; \"unreachable\" },\lexiting scope_4 stmt if x == 1i { continue \'outer ; \"unreachable\" },\lexiting scope_5 block {\l if x == 1i { continue \'outer ; \"unreachable\" }\l if y >= 1i { break ; \"unreachable\" }\l y -= 1i;\l}\l,\lexiting scope_6 expr \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\" }\l if y >= 1i { break ; \"unreachable\" }\l y -= 1i;\l }\l,\lexiting scope_7 stmt \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\" }\l if y >= 1i { break ; \"unreachable\" }\l y -= 1i;\l }\l,\lexiting scope_8 block {\l \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\" }\l if y >= 1i { break ; \"unreachable\" }\l y -= 1i;\l }\l y -= 1i;\l x -= 1i;\l}\l"]; N14 -> N15; N15 -> N16; N12 -> N17; @@ -57,7 +57,7 @@ digraph block { N18 -> N19; N19 -> N20; N20 -> N21; - N21 -> N9[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\" },\lexiting scope_3 expr if y >= 1 { break ; \"unreachable\" },\lexiting scope_4 stmt if y >= 1 { break ; \"unreachable\" },\lexiting scope_5 block {\l if x == 1 { continue \'outer ; \"unreachable\" }\l if y >= 1 { break ; \"unreachable\" }\l y -= 1;\l}\l"]; + N21 -> N9[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\" },\lexiting scope_3 expr if y >= 1i { break ; \"unreachable\" },\lexiting scope_4 stmt if y >= 1i { break ; \"unreachable\" },\lexiting scope_5 block {\l if x == 1i { continue \'outer ; \"unreachable\" }\l if y >= 1i { break ; \"unreachable\" }\l y -= 1i;\l}\l"]; N22 -> N23; N23 -> N24; N20 -> N25; diff --git a/src/test/run-make/graphviz-flowgraph/f16.rs b/src/test/run-make/graphviz-flowgraph/f16.rs index f4f23a65c9350..78de99d28fcce 100644 --- a/src/test/run-make/graphviz-flowgraph/f16.rs +++ b/src/test/run-make/graphviz-flowgraph/f16.rs @@ -10,22 +10,22 @@ #[allow(unreachable_code)] pub fn expr_continue_label_16() { - let mut x = 16; - let mut y = 16; + let mut x = 16i; + let mut y = 16i; 'outer: loop { 'inner: loop { - if x == 1 { + if x == 1i { continue 'outer; "unreachable" } - if y >= 1 { + if y >= 1i { break; "unreachable" } - y -= 1; + y -= 1i; } - y -= 1; - x -= 1; + y -= 1i; + x -= 1i; } "unreachable"; } diff --git a/src/test/run-make/graphviz-flowgraph/f17.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f17.dot-expected.dot index e9bccdab81be1..d3e098a71f287 100644 --- a/src/test/run-make/graphviz-flowgraph/f17.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f17.dot-expected.dot @@ -1,12 +1,12 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 1"]; - N3[label="expr 7"]; - N4[label="expr 17"]; - N5[label="expr [1, 7, 17]"]; + N2[label="expr 1i"]; + N3[label="expr 7i"]; + N4[label="expr 17i"]; + N5[label="expr [1i, 7i, 17i]"]; N6[label="local _v"]; - N7[label="block { let _v = [1, 7, 17]; }"]; + N7[label="block { let _v = [1i, 7i, 17i]; }"]; N0 -> N2; N2 -> N3; N3 -> N4; diff --git a/src/test/run-make/graphviz-flowgraph/f17.rs b/src/test/run-make/graphviz-flowgraph/f17.rs index 23f5bb8a1eb17..23ce212c0af48 100644 --- a/src/test/run-make/graphviz-flowgraph/f17.rs +++ b/src/test/run-make/graphviz-flowgraph/f17.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn expr_vec_17() { - let _v = [1, 7, 17]; + let _v = [1i, 7i, 17i]; } diff --git a/src/test/run-make/graphviz-flowgraph/f20.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f20.dot-expected.dot index 593ad6f91ea5c..716ec469fb001 100644 --- a/src/test/run-make/graphviz-flowgraph/f20.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f20.dot-expected.dot @@ -1,15 +1,15 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 2"]; - N3[label="expr 0"]; - N4[label="expr 20"]; - N5[label="expr [2, 0, 20]"]; + N2[label="expr 2u"]; + N3[label="expr 0u"]; + N4[label="expr 20u"]; + N5[label="expr [2u, 0u, 20u]"]; N6[label="local v"]; N7[label="expr v"]; - N8[label="expr 20"]; - N9[label="expr v[20]"]; - N10[label="block { let v = [2, 0, 20]; v[20]; }"]; + N8[label="expr 20u"]; + N9[label="expr v[20u]"]; + N10[label="block { let v = [2u, 0u, 20u]; v[20u]; }"]; N0 -> N2; N2 -> N3; N3 -> N4; diff --git a/src/test/run-make/graphviz-flowgraph/f20.rs b/src/test/run-make/graphviz-flowgraph/f20.rs index d7349932355b1..7110ebe2b5429 100644 --- a/src/test/run-make/graphviz-flowgraph/f20.rs +++ b/src/test/run-make/graphviz-flowgraph/f20.rs @@ -9,6 +9,6 @@ // except according to those terms. pub fn expr_index_20() { - let v = [2, 0, 20]; - v[20]; + let v = [2u, 0u, 20u]; + v[20u]; } diff --git a/src/test/run-make/graphviz-flowgraph/f21.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f21.dot-expected.dot index 0798c4a01c05a..2bbc3e7e5c8f0 100644 --- a/src/test/run-make/graphviz-flowgraph/f21.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f21.dot-expected.dot @@ -1,40 +1,40 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 15"]; + N2[label="expr 15i"]; N3[label="local mut x"]; - N4[label="expr 151"]; + N4[label="expr 151i"]; N5[label="local mut y"]; N6[label="(dummy_node)"]; - N7[label="expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l }\l \"unreachable\";\l }\l"]; + N7[label="expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l y -= 3i;\l x -= 5i;\l }\l \"unreachable\";\l }\l"]; N8[label="(dummy_node)"]; - N9[label="expr \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l }\l"]; + N9[label="expr \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l y -= 3i;\l x -= 5i;\l }\l"]; N10[label="expr x"]; - N11[label="expr 1"]; - N12[label="expr x == 1"]; + N11[label="expr 1i"]; + N12[label="expr x == 1i"]; N13[label="expr break \'outer"]; N14[label="(dummy_node)"]; N15[label="expr \"unreachable\""]; N16[label="block { break \'outer ; \"unreachable\"; }"]; - N17[label="expr if x == 1 { break \'outer ; \"unreachable\"; }"]; + N17[label="expr if x == 1i { break \'outer ; \"unreachable\"; }"]; N18[label="expr y"]; - N19[label="expr 2"]; - N20[label="expr y >= 2"]; + N19[label="expr 2i"]; + N20[label="expr y >= 2i"]; N21[label="expr return"]; N22[label="(dummy_node)"]; N23[label="expr \"unreachable\""]; N24[label="block { return; \"unreachable\"; }"]; - N25[label="expr if y >= 2 { return; \"unreachable\"; }"]; - N26[label="expr 3"]; + N25[label="expr if y >= 2i { return; \"unreachable\"; }"]; + N26[label="expr 3i"]; N27[label="expr y"]; - N28[label="expr y -= 3"]; - N29[label="expr 5"]; + N28[label="expr y -= 3i"]; + N29[label="expr 5i"]; N30[label="expr x"]; - N31[label="expr x -= 5"]; - N32[label="block {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l}\l"]; + N31[label="expr x -= 5i"]; + N32[label="block {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l y -= 3i;\l x -= 5i;\l}\l"]; N33[label="expr \"unreachable\""]; - N34[label="block {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l }\l \"unreachable\";\l}\l"]; - N35[label="block {\l let mut x = 15;\l let mut y = 151;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l }\l \"unreachable\";\l }\l}\l"]; + N34[label="block {\l \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l y -= 3i;\l x -= 5i;\l }\l \"unreachable\";\l}\l"]; + N35[label="block {\l let mut x = 15i;\l let mut y = 151i;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l y -= 3i;\l x -= 5i;\l }\l \"unreachable\";\l }\l}\l"]; N0 -> N2; N2 -> N3; N3 -> N4; @@ -45,7 +45,7 @@ digraph block { N10 -> N11; N11 -> N12; N12 -> N13; - N13 -> N7[label="exiting scope_0 expr break \'outer,\lexiting scope_1 stmt break \'outer ;,\lexiting scope_2 block { break \'outer ; \"unreachable\"; },\lexiting scope_3 expr if x == 1 { break \'outer ; \"unreachable\"; },\lexiting scope_4 stmt if x == 1 { break \'outer ; \"unreachable\"; },\lexiting scope_5 block {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l}\l,\lexiting scope_6 expr \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l }\l,\lexiting scope_7 stmt \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l }\l,\lexiting scope_8 block {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l }\l \"unreachable\";\l}\l"]; + N13 -> N7[label="exiting scope_0 expr break \'outer,\lexiting scope_1 stmt break \'outer ;,\lexiting scope_2 block { break \'outer ; \"unreachable\"; },\lexiting scope_3 expr if x == 1i { break \'outer ; \"unreachable\"; },\lexiting scope_4 stmt if x == 1i { break \'outer ; \"unreachable\"; },\lexiting scope_5 block {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l y -= 3i;\l x -= 5i;\l}\l,\lexiting scope_6 expr \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l y -= 3i;\l x -= 5i;\l }\l,\lexiting scope_7 stmt \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l y -= 3i;\l x -= 5i;\l }\l,\lexiting scope_8 block {\l \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l y -= 3i;\l x -= 5i;\l }\l \"unreachable\";\l}\l"]; N14 -> N15; N15 -> N16; N12 -> N17; @@ -54,7 +54,7 @@ digraph block { N18 -> N19; N19 -> N20; N20 -> N21; - N21 -> N1[label="exiting scope_0 expr \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l }\l,\lexiting scope_1 expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { break \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l y -= 3;\l x -= 5;\l }\l \"unreachable\";\l }\l"]; + N21 -> N1[label="exiting scope_0 expr \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l y -= 3i;\l x -= 5i;\l }\l,\lexiting scope_1 expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1i { break \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l y -= 3i;\l x -= 5i;\l }\l \"unreachable\";\l }\l"]; N22 -> N23; N23 -> N24; N20 -> N25; diff --git a/src/test/run-make/graphviz-flowgraph/f21.rs b/src/test/run-make/graphviz-flowgraph/f21.rs index 70083ed8312cb..bff2da2506107 100644 --- a/src/test/run-make/graphviz-flowgraph/f21.rs +++ b/src/test/run-make/graphviz-flowgraph/f21.rs @@ -10,20 +10,20 @@ #[allow(unreachable_code)] pub fn expr_break_label_21() { - let mut x = 15; - let mut y = 151; + let mut x = 15i; + let mut y = 151i; 'outer: loop { 'inner: loop { - if x == 1 { + if x == 1i { break 'outer; "unreachable"; } - if y >= 2 { + if y >= 2i { return; "unreachable"; } - y -= 3; - x -= 5; + y -= 3i; + x -= 5i; } "unreachable"; } diff --git a/src/test/run-make/graphviz-flowgraph/f22.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f22.dot-expected.dot index 9ad731bc756bf..8ecddba21fcc1 100644 --- a/src/test/run-make/graphviz-flowgraph/f22.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f22.dot-expected.dot @@ -1,41 +1,41 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 15"]; + N2[label="expr 15i"]; N3[label="local mut x"]; - N4[label="expr 151"]; + N4[label="expr 151i"]; N5[label="local mut y"]; N6[label="(dummy_node)"]; - N7[label="expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l }\l \"unreachable\";\l }\l"]; + N7[label="expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l x -= 1i;\l y -= 3i;\l }\l \"unreachable\";\l }\l"]; N8[label="(dummy_node)"]; - N9[label="expr \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l }\l"]; + N9[label="expr \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l x -= 1i;\l y -= 3i;\l }\l"]; N10[label="expr x"]; - N11[label="expr 1"]; - N12[label="expr x == 1"]; + N11[label="expr 1i"]; + N12[label="expr x == 1i"]; N13[label="expr continue \'outer"]; N14[label="(dummy_node)"]; N15[label="expr \"unreachable\""]; N16[label="block { continue \'outer ; \"unreachable\"; }"]; - N17[label="expr if x == 1 { continue \'outer ; \"unreachable\"; }"]; + N17[label="expr if x == 1i { continue \'outer ; \"unreachable\"; }"]; N18[label="expr y"]; - N19[label="expr 2"]; - N20[label="expr y >= 2"]; + N19[label="expr 2i"]; + N20[label="expr y >= 2i"]; N21[label="expr return"]; N22[label="(dummy_node)"]; N23[label="expr \"unreachable\""]; N24[label="block { return; \"unreachable\"; }"]; - N25[label="expr if y >= 2 { return; \"unreachable\"; }"]; - N26[label="expr 1"]; + N25[label="expr if y >= 2i { return; \"unreachable\"; }"]; + N26[label="expr 1i"]; N27[label="expr x"]; - N28[label="expr x -= 1"]; - N29[label="expr 3"]; + N28[label="expr x -= 1i"]; + N29[label="expr 3i"]; N30[label="expr y"]; - N31[label="expr y -= 3"]; - N32[label="block {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l}\l"]; + N31[label="expr y -= 3i"]; + N32[label="block {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l x -= 1i;\l y -= 3i;\l}\l"]; N33[label="expr \"unreachable\""]; - N34[label="block {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l }\l \"unreachable\";\l}\l"]; + N34[label="block {\l \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l x -= 1i;\l y -= 3i;\l }\l \"unreachable\";\l}\l"]; N35[label="expr \"unreachable\""]; - N36[label="block {\l let mut x = 15;\l let mut y = 151;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l }\l \"unreachable\";\l }\l \"unreachable\";\l}\l"]; + N36[label="block {\l let mut x = 15i;\l let mut y = 151i;\l \'outer:\l loop {\l \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l x -= 1i;\l y -= 3i;\l }\l \"unreachable\";\l }\l \"unreachable\";\l}\l"]; N0 -> N2; N2 -> N3; N3 -> N4; @@ -46,7 +46,7 @@ digraph block { N10 -> N11; N11 -> N12; N12 -> N13; - N13 -> N6[label="exiting scope_0 expr continue \'outer,\lexiting scope_1 stmt continue \'outer ;,\lexiting scope_2 block { continue \'outer ; \"unreachable\"; },\lexiting scope_3 expr if x == 1 { continue \'outer ; \"unreachable\"; },\lexiting scope_4 stmt if x == 1 { continue \'outer ; \"unreachable\"; },\lexiting scope_5 block {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l}\l,\lexiting scope_6 expr \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l }\l,\lexiting scope_7 stmt \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l }\l,\lexiting scope_8 block {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l }\l \"unreachable\";\l}\l"]; + N13 -> N6[label="exiting scope_0 expr continue \'outer,\lexiting scope_1 stmt continue \'outer ;,\lexiting scope_2 block { continue \'outer ; \"unreachable\"; },\lexiting scope_3 expr if x == 1i { continue \'outer ; \"unreachable\"; },\lexiting scope_4 stmt if x == 1i { continue \'outer ; \"unreachable\"; },\lexiting scope_5 block {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l x -= 1i;\l y -= 3i;\l}\l,\lexiting scope_6 expr \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l x -= 1i;\l y -= 3i;\l }\l,\lexiting scope_7 stmt \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l x -= 1i;\l y -= 3i;\l }\l,\lexiting scope_8 block {\l \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l x -= 1i;\l y -= 3i;\l }\l \"unreachable\";\l}\l"]; N14 -> N15; N15 -> N16; N12 -> N17; @@ -55,7 +55,7 @@ digraph block { N18 -> N19; N19 -> N20; N20 -> N21; - N21 -> N1[label="exiting scope_0 expr \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l }\l,\lexiting scope_1 expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1 { continue \'outer ; \"unreachable\"; }\l if y >= 2 { return; \"unreachable\"; }\l x -= 1;\l y -= 3;\l }\l \"unreachable\";\l }\l"]; + N21 -> N1[label="exiting scope_0 expr \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l x -= 1i;\l y -= 3i;\l }\l,\lexiting scope_1 expr \'outer:\l loop {\l \'inner:\l loop {\l if x == 1i { continue \'outer ; \"unreachable\"; }\l if y >= 2i { return; \"unreachable\"; }\l x -= 1i;\l y -= 3i;\l }\l \"unreachable\";\l }\l"]; N22 -> N23; N23 -> N24; N20 -> N25; diff --git a/src/test/run-make/graphviz-flowgraph/f22.rs b/src/test/run-make/graphviz-flowgraph/f22.rs index b35aac9ec422e..a6e3d571debab 100644 --- a/src/test/run-make/graphviz-flowgraph/f22.rs +++ b/src/test/run-make/graphviz-flowgraph/f22.rs @@ -10,20 +10,20 @@ #[allow(unreachable_code)] pub fn expr_break_label_21() { - let mut x = 15; - let mut y = 151; + let mut x = 15i; + let mut y = 151i; 'outer: loop { 'inner: loop { - if x == 1 { + if x == 1i { continue 'outer; "unreachable"; } - if y >= 2 { + if y >= 2i { return; "unreachable"; } - x -= 1; - y -= 3; + x -= 1i; + y -= 3i; } "unreachable"; } diff --git a/src/test/run-make/graphviz-flowgraph/f23.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f23.dot-expected.dot index 876957a0689d6..718d4687ef990 100644 --- a/src/test/run-make/graphviz-flowgraph/f23.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f23.dot-expected.dot @@ -1,48 +1,48 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 23"]; + N2[label="expr 23i"]; N3[label="local mut x"]; - N4[label="expr 23"]; + N4[label="expr 23i"]; N5[label="local mut y"]; - N6[label="expr 23"]; + N6[label="expr 23i"]; N7[label="local mut z"]; N8[label="(dummy_node)"]; N9[label="expr x"]; - N10[label="expr 0"]; - N11[label="expr x > 0"]; - N12[label="expr while x > 0 {\l x -= 1;\l while y > 0 {\l y -= 1;\l while z > 0 { z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l}\l"]; - N13[label="expr 1"]; + N10[label="expr 0i"]; + N11[label="expr x > 0i"]; + N12[label="expr while x > 0i {\l x -= 1i;\l while y > 0i {\l y -= 1i;\l while z > 0i { z -= 1i; }\l if x > 10i { return; \"unreachable\"; }\l }\l}\l"]; + N13[label="expr 1i"]; N14[label="expr x"]; - N15[label="expr x -= 1"]; + N15[label="expr x -= 1i"]; N16[label="(dummy_node)"]; N17[label="expr y"]; - N18[label="expr 0"]; - N19[label="expr y > 0"]; - N20[label="expr while y > 0 {\l y -= 1;\l while z > 0 { z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l}\l"]; - N21[label="expr 1"]; + N18[label="expr 0i"]; + N19[label="expr y > 0i"]; + N20[label="expr while y > 0i {\l y -= 1i;\l while z > 0i { z -= 1i; }\l if x > 10i { return; \"unreachable\"; }\l}\l"]; + N21[label="expr 1i"]; N22[label="expr y"]; - N23[label="expr y -= 1"]; + N23[label="expr y -= 1i"]; N24[label="(dummy_node)"]; N25[label="expr z"]; - N26[label="expr 0"]; - N27[label="expr z > 0"]; - N28[label="expr while z > 0 { z -= 1; }"]; - N29[label="expr 1"]; + N26[label="expr 0i"]; + N27[label="expr z > 0i"]; + N28[label="expr while z > 0i { z -= 1i; }"]; + N29[label="expr 1i"]; N30[label="expr z"]; - N31[label="expr z -= 1"]; - N32[label="block { z -= 1; }"]; + N31[label="expr z -= 1i"]; + N32[label="block { z -= 1i; }"]; N33[label="expr x"]; - N34[label="expr 10"]; - N35[label="expr x > 10"]; + N34[label="expr 10i"]; + N35[label="expr x > 10i"]; N36[label="expr return"]; N37[label="(dummy_node)"]; N38[label="expr \"unreachable\""]; N39[label="block { return; \"unreachable\"; }"]; - N40[label="expr if x > 10 { return; \"unreachable\"; }"]; - N41[label="block { y -= 1; while z > 0 { z -= 1; } if x > 10 { return; \"unreachable\"; } }"]; - N42[label="block {\l x -= 1;\l while y > 0 {\l y -= 1;\l while z > 0 { z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l}\l"]; - N43[label="block {\l let mut x = 23;\l let mut y = 23;\l let mut z = 23;\l while x > 0 {\l x -= 1;\l while y > 0 {\l y -= 1;\l while z > 0 { z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l }\l}\l"]; + N40[label="expr if x > 10i { return; \"unreachable\"; }"]; + N41[label="block { y -= 1i; while z > 0i { z -= 1i; } if x > 10i { return; \"unreachable\"; } }"]; + N42[label="block {\l x -= 1i;\l while y > 0i {\l y -= 1i;\l while z > 0i { z -= 1i; }\l if x > 10i { return; \"unreachable\"; }\l }\l}\l"]; + N43[label="block {\l let mut x = 23i;\l let mut y = 23i;\l let mut z = 23i;\l while x > 0i {\l x -= 1i;\l while y > 0i {\l y -= 1i;\l while z > 0i { z -= 1i; }\l if x > 10i { return; \"unreachable\"; }\l }\l }\l}\l"]; N0 -> N2; N2 -> N3; N3 -> N4; @@ -79,7 +79,7 @@ digraph block { N33 -> N34; N34 -> N35; N35 -> N36; - N36 -> N1[label="exiting scope_0 expr while y > 0 {\l y -= 1;\l while z > 0 { z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l}\l,\lexiting scope_1 expr while x > 0 {\l x -= 1;\l while y > 0 {\l y -= 1;\l while z > 0 { z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l}\l"]; + N36 -> N1[label="exiting scope_0 expr while y > 0i {\l y -= 1i;\l while z > 0i { z -= 1i; }\l if x > 10i { return; \"unreachable\"; }\l}\l,\lexiting scope_1 expr while x > 0i {\l x -= 1i;\l while y > 0i {\l y -= 1i;\l while z > 0i { z -= 1i; }\l if x > 10i { return; \"unreachable\"; }\l }\l}\l"]; N37 -> N38; N38 -> N39; N35 -> N40; diff --git a/src/test/run-make/graphviz-flowgraph/f23.rs b/src/test/run-make/graphviz-flowgraph/f23.rs index 52341a3fbd408..73bcc288ca7a2 100644 --- a/src/test/run-make/graphviz-flowgraph/f23.rs +++ b/src/test/run-make/graphviz-flowgraph/f23.rs @@ -10,19 +10,19 @@ #[allow(unreachable_code)] pub fn expr_while_23() { - let mut x = 23; - let mut y = 23; - let mut z = 23; + let mut x = 23i; + let mut y = 23i; + let mut z = 23i; - while x > 0 { - x -= 1; + while x > 0i { + x -= 1i; - while y > 0 { - y -= 1; + while y > 0i { + y -= 1i; - while z > 0 { z -= 1; } + while z > 0i { z -= 1i; } - if x > 10 { + if x > 10i { return; "unreachable"; } diff --git a/src/test/run-make/graphviz-flowgraph/f24.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f24.dot-expected.dot index 2558998be6e1f..646d98a54a786 100644 --- a/src/test/run-make/graphviz-flowgraph/f24.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f24.dot-expected.dot @@ -1,63 +1,63 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 24"]; + N2[label="expr 24i"]; N3[label="local mut x"]; - N4[label="expr 24"]; + N4[label="expr 24i"]; N5[label="local mut y"]; - N6[label="expr 24"]; + N6[label="expr 24i"]; N7[label="local mut z"]; N8[label="(dummy_node)"]; - N9[label="expr loop {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l}\l"]; + N9[label="expr loop {\l if x == 0i { break ; \"unreachable\"; }\l x -= 1i;\l loop {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }\l if x > 10i { return; \"unreachable\"; }\l }\l}\l"]; N10[label="expr x"]; - N11[label="expr 0"]; - N12[label="expr x == 0"]; + N11[label="expr 0i"]; + N12[label="expr x == 0i"]; N13[label="expr break"]; N14[label="(dummy_node)"]; N15[label="expr \"unreachable\""]; N16[label="block { break ; \"unreachable\"; }"]; - N17[label="expr if x == 0 { break ; \"unreachable\"; }"]; - N18[label="expr 1"]; + N17[label="expr if x == 0i { break ; \"unreachable\"; }"]; + N18[label="expr 1i"]; N19[label="expr x"]; - N20[label="expr x -= 1"]; + N20[label="expr x -= 1i"]; N21[label="(dummy_node)"]; - N22[label="expr loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l}\l"]; + N22[label="expr loop {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }\l if x > 10i { return; \"unreachable\"; }\l}\l"]; N23[label="expr y"]; - N24[label="expr 0"]; - N25[label="expr y == 0"]; + N24[label="expr 0i"]; + N25[label="expr y == 0i"]; N26[label="expr break"]; N27[label="(dummy_node)"]; N28[label="expr \"unreachable\""]; N29[label="block { break ; \"unreachable\"; }"]; - N30[label="expr if y == 0 { break ; \"unreachable\"; }"]; - N31[label="expr 1"]; + N30[label="expr if y == 0i { break ; \"unreachable\"; }"]; + N31[label="expr 1i"]; N32[label="expr y"]; - N33[label="expr y -= 1"]; + N33[label="expr y -= 1i"]; N34[label="(dummy_node)"]; - N35[label="expr loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }"]; + N35[label="expr loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }"]; N36[label="expr z"]; - N37[label="expr 0"]; - N38[label="expr z == 0"]; + N37[label="expr 0i"]; + N38[label="expr z == 0i"]; N39[label="expr break"]; N40[label="(dummy_node)"]; N41[label="expr \"unreachable\""]; N42[label="block { break ; \"unreachable\"; }"]; - N43[label="expr if z == 0 { break ; \"unreachable\"; }"]; - N44[label="expr 1"]; + N43[label="expr if z == 0i { break ; \"unreachable\"; }"]; + N44[label="expr 1i"]; N45[label="expr z"]; - N46[label="expr z -= 1"]; - N47[label="block { if z == 0 { break ; \"unreachable\"; } z -= 1; }"]; + N46[label="expr z -= 1i"]; + N47[label="block { if z == 0i { break ; \"unreachable\"; } z -= 1i; }"]; N48[label="expr x"]; - N49[label="expr 10"]; - N50[label="expr x > 10"]; + N49[label="expr 10i"]; + N50[label="expr x > 10i"]; N51[label="expr return"]; N52[label="(dummy_node)"]; N53[label="expr \"unreachable\""]; N54[label="block { return; \"unreachable\"; }"]; - N55[label="expr if x > 10 { return; \"unreachable\"; }"]; - N56[label="block {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l}\l"]; - N57[label="block {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l}\l"]; - N58[label="block {\l let mut x = 24;\l let mut y = 24;\l let mut z = 24;\l loop {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l }\l}\l"]; + N55[label="expr if x > 10i { return; \"unreachable\"; }"]; + N56[label="block {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }\l if x > 10i { return; \"unreachable\"; }\l}\l"]; + N57[label="block {\l if x == 0i { break ; \"unreachable\"; }\l x -= 1i;\l loop {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }\l if x > 10i { return; \"unreachable\"; }\l }\l}\l"]; + N58[label="block {\l let mut x = 24i;\l let mut y = 24i;\l let mut z = 24i;\l loop {\l if x == 0i { break ; \"unreachable\"; }\l x -= 1i;\l loop {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }\l if x > 10i { return; \"unreachable\"; }\l }\l }\l}\l"]; N0 -> N2; N2 -> N3; N3 -> N4; @@ -69,7 +69,7 @@ digraph block { N10 -> N11; N11 -> N12; N12 -> N13; - N13 -> N9[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if x == 0 { break ; \"unreachable\"; },\lexiting scope_4 stmt if x == 0 { break ; \"unreachable\"; },\lexiting scope_5 block {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l}\l"]; + N13 -> N9[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if x == 0i { break ; \"unreachable\"; },\lexiting scope_4 stmt if x == 0i { break ; \"unreachable\"; },\lexiting scope_5 block {\l if x == 0i { break ; \"unreachable\"; }\l x -= 1i;\l loop {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }\l if x > 10i { return; \"unreachable\"; }\l }\l}\l"]; N14 -> N15; N15 -> N16; N12 -> N17; @@ -82,7 +82,7 @@ digraph block { N23 -> N24; N24 -> N25; N25 -> N26; - N26 -> N22[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if y == 0 { break ; \"unreachable\"; },\lexiting scope_4 stmt if y == 0 { break ; \"unreachable\"; },\lexiting scope_5 block {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l}\l"]; + N26 -> N22[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if y == 0i { break ; \"unreachable\"; },\lexiting scope_4 stmt if y == 0i { break ; \"unreachable\"; },\lexiting scope_5 block {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }\l if x > 10i { return; \"unreachable\"; }\l}\l"]; N27 -> N28; N28 -> N29; N25 -> N30; @@ -95,7 +95,7 @@ digraph block { N36 -> N37; N37 -> N38; N38 -> N39; - N39 -> N35[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if z == 0 { break ; \"unreachable\"; },\lexiting scope_4 stmt if z == 0 { break ; \"unreachable\"; },\lexiting scope_5 block { if z == 0 { break ; \"unreachable\"; } z -= 1; }"]; + N39 -> N35[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if z == 0i { break ; \"unreachable\"; },\lexiting scope_4 stmt if z == 0i { break ; \"unreachable\"; },\lexiting scope_5 block { if z == 0i { break ; \"unreachable\"; } z -= 1i; }"]; N40 -> N41; N41 -> N42; N38 -> N43; @@ -109,7 +109,7 @@ digraph block { N48 -> N49; N49 -> N50; N50 -> N51; - N51 -> N1[label="exiting scope_0 expr loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l}\l,\lexiting scope_1 expr loop {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { return; \"unreachable\"; }\l }\l}\l"]; + N51 -> N1[label="exiting scope_0 expr loop {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }\l if x > 10i { return; \"unreachable\"; }\l}\l,\lexiting scope_1 expr loop {\l if x == 0i { break ; \"unreachable\"; }\l x -= 1i;\l loop {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }\l if x > 10i { return; \"unreachable\"; }\l }\l}\l"]; N52 -> N53; N53 -> N54; N50 -> N55; diff --git a/src/test/run-make/graphviz-flowgraph/f24.rs b/src/test/run-make/graphviz-flowgraph/f24.rs index f796d660a1856..afba1d202c927 100644 --- a/src/test/run-make/graphviz-flowgraph/f24.rs +++ b/src/test/run-make/graphviz-flowgraph/f24.rs @@ -10,24 +10,24 @@ #[allow(unreachable_code)] pub fn expr_while_24() { - let mut x = 24; - let mut y = 24; - let mut z = 24; + let mut x = 24i; + let mut y = 24i; + let mut z = 24i; loop { - if x == 0 { break; "unreachable"; } - x -= 1; + if x == 0i { break; "unreachable"; } + x -= 1i; loop { - if y == 0 { break; "unreachable"; } - y -= 1; + if y == 0i { break; "unreachable"; } + y -= 1i; loop { - if z == 0 { break; "unreachable"; } - z -= 1; + if z == 0i { break; "unreachable"; } + z -= 1i; } - if x > 10 { + if x > 10i { return; "unreachable"; } diff --git a/src/test/run-make/graphviz-flowgraph/f25.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f25.dot-expected.dot index c393b63546c70..11b9c7ef05ecb 100644 --- a/src/test/run-make/graphviz-flowgraph/f25.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f25.dot-expected.dot @@ -1,63 +1,63 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 25"]; + N2[label="expr 25i"]; N3[label="local mut x"]; - N4[label="expr 25"]; + N4[label="expr 25i"]; N5[label="local mut y"]; - N6[label="expr 25"]; + N6[label="expr 25i"]; N7[label="local mut z"]; N8[label="(dummy_node)"]; - N9[label="expr \'a:\l loop {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l \'a:\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { continue \'a ; \"unreachable\"; }\l }\l }\l"]; + N9[label="expr \'a:\l loop {\l if x == 0i { break ; \"unreachable\"; }\l x -= 1i;\l \'a:\l loop {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l \'a: loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }\l if x > 10i { continue \'a ; \"unreachable\"; }\l }\l }\l"]; N10[label="expr x"]; - N11[label="expr 0"]; - N12[label="expr x == 0"]; + N11[label="expr 0i"]; + N12[label="expr x == 0i"]; N13[label="expr break"]; N14[label="(dummy_node)"]; N15[label="expr \"unreachable\""]; N16[label="block { break ; \"unreachable\"; }"]; - N17[label="expr if x == 0 { break ; \"unreachable\"; }"]; - N18[label="expr 1"]; + N17[label="expr if x == 0i { break ; \"unreachable\"; }"]; + N18[label="expr 1i"]; N19[label="expr x"]; - N20[label="expr x -= 1"]; + N20[label="expr x -= 1i"]; N21[label="(dummy_node)"]; - N22[label="expr \'a:\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { continue \'a ; \"unreachable\"; }\l }\l"]; + N22[label="expr \'a:\l loop {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l \'a: loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }\l if x > 10i { continue \'a ; \"unreachable\"; }\l }\l"]; N23[label="expr y"]; - N24[label="expr 0"]; - N25[label="expr y == 0"]; + N24[label="expr 0i"]; + N25[label="expr y == 0i"]; N26[label="expr break"]; N27[label="(dummy_node)"]; N28[label="expr \"unreachable\""]; N29[label="block { break ; \"unreachable\"; }"]; - N30[label="expr if y == 0 { break ; \"unreachable\"; }"]; - N31[label="expr 1"]; + N30[label="expr if y == 0i { break ; \"unreachable\"; }"]; + N31[label="expr 1i"]; N32[label="expr y"]; - N33[label="expr y -= 1"]; + N33[label="expr y -= 1i"]; N34[label="(dummy_node)"]; - N35[label="expr \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }"]; + N35[label="expr \'a: loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }"]; N36[label="expr z"]; - N37[label="expr 0"]; - N38[label="expr z == 0"]; + N37[label="expr 0i"]; + N38[label="expr z == 0i"]; N39[label="expr break"]; N40[label="(dummy_node)"]; N41[label="expr \"unreachable\""]; N42[label="block { break ; \"unreachable\"; }"]; - N43[label="expr if z == 0 { break ; \"unreachable\"; }"]; - N44[label="expr 1"]; + N43[label="expr if z == 0i { break ; \"unreachable\"; }"]; + N44[label="expr 1i"]; N45[label="expr z"]; - N46[label="expr z -= 1"]; - N47[label="block { if z == 0 { break ; \"unreachable\"; } z -= 1; }"]; + N46[label="expr z -= 1i"]; + N47[label="block { if z == 0i { break ; \"unreachable\"; } z -= 1i; }"]; N48[label="expr x"]; - N49[label="expr 10"]; - N50[label="expr x > 10"]; + N49[label="expr 10i"]; + N50[label="expr x > 10i"]; N51[label="expr continue \'a"]; N52[label="(dummy_node)"]; N53[label="expr \"unreachable\""]; N54[label="block { continue \'a ; \"unreachable\"; }"]; - N55[label="expr if x > 10 { continue \'a ; \"unreachable\"; }"]; - N56[label="block {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { continue \'a ; \"unreachable\"; }\l}\l"]; - N57[label="block {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l \'a:\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { continue \'a ; \"unreachable\"; }\l }\l}\l"]; - N58[label="block {\l let mut x = 25;\l let mut y = 25;\l let mut z = 25;\l \'a:\l loop {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l \'a:\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { continue \'a ; \"unreachable\"; }\l }\l }\l}\l"]; + N55[label="expr if x > 10i { continue \'a ; \"unreachable\"; }"]; + N56[label="block {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l \'a: loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }\l if x > 10i { continue \'a ; \"unreachable\"; }\l}\l"]; + N57[label="block {\l if x == 0i { break ; \"unreachable\"; }\l x -= 1i;\l \'a:\l loop {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l \'a: loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }\l if x > 10i { continue \'a ; \"unreachable\"; }\l }\l}\l"]; + N58[label="block {\l let mut x = 25i;\l let mut y = 25i;\l let mut z = 25i;\l \'a:\l loop {\l if x == 0i { break ; \"unreachable\"; }\l x -= 1i;\l \'a:\l loop {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l \'a:\l loop {\l if z == 0i { break ; \"unreachable\"; }\l z -= 1i;\l }\l if x > 10i { continue \'a ; \"unreachable\"; }\l }\l }\l}\l"]; N0 -> N2; N2 -> N3; N3 -> N4; @@ -69,7 +69,7 @@ digraph block { N10 -> N11; N11 -> N12; N12 -> N13; - N13 -> N9[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if x == 0 { break ; \"unreachable\"; },\lexiting scope_4 stmt if x == 0 { break ; \"unreachable\"; },\lexiting scope_5 block {\l if x == 0 { break ; \"unreachable\"; }\l x -= 1;\l \'a:\l loop {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { continue \'a ; \"unreachable\"; }\l }\l}\l"]; + N13 -> N9[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if x == 0i { break ; \"unreachable\"; },\lexiting scope_4 stmt if x == 0i { break ; \"unreachable\"; },\lexiting scope_5 block {\l if x == 0i { break ; \"unreachable\"; }\l x -= 1i;\l \'a:\l loop {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l \'a: loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }\l if x > 10i { continue \'a ; \"unreachable\"; }\l }\l}\l"]; N14 -> N15; N15 -> N16; N12 -> N17; @@ -82,7 +82,7 @@ digraph block { N23 -> N24; N24 -> N25; N25 -> N26; - N26 -> N22[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if y == 0 { break ; \"unreachable\"; },\lexiting scope_4 stmt if y == 0 { break ; \"unreachable\"; },\lexiting scope_5 block {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { continue \'a ; \"unreachable\"; }\l}\l"]; + N26 -> N22[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if y == 0i { break ; \"unreachable\"; },\lexiting scope_4 stmt if y == 0i { break ; \"unreachable\"; },\lexiting scope_5 block {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l \'a: loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }\l if x > 10i { continue \'a ; \"unreachable\"; }\l}\l"]; N27 -> N28; N28 -> N29; N25 -> N30; @@ -95,7 +95,7 @@ digraph block { N36 -> N37; N37 -> N38; N38 -> N39; - N39 -> N35[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if z == 0 { break ; \"unreachable\"; },\lexiting scope_4 stmt if z == 0 { break ; \"unreachable\"; },\lexiting scope_5 block { if z == 0 { break ; \"unreachable\"; } z -= 1; }"]; + N39 -> N35[label="exiting scope_0 expr break,\lexiting scope_1 stmt break ;,\lexiting scope_2 block { break ; \"unreachable\"; },\lexiting scope_3 expr if z == 0i { break ; \"unreachable\"; },\lexiting scope_4 stmt if z == 0i { break ; \"unreachable\"; },\lexiting scope_5 block { if z == 0i { break ; \"unreachable\"; } z -= 1i; }"]; N40 -> N41; N41 -> N42; N38 -> N43; @@ -109,7 +109,7 @@ digraph block { N48 -> N49; N49 -> N50; N50 -> N51; - N51 -> N21[label="exiting scope_0 expr continue \'a,\lexiting scope_1 stmt continue \'a ;,\lexiting scope_2 block { continue \'a ; \"unreachable\"; },\lexiting scope_3 expr if x > 10 { continue \'a ; \"unreachable\"; },\lexiting scope_4 block {\l if y == 0 { break ; \"unreachable\"; }\l y -= 1;\l \'a: loop { if z == 0 { break ; \"unreachable\"; } z -= 1; }\l if x > 10 { continue \'a ; \"unreachable\"; }\l}\l"]; + N51 -> N21[label="exiting scope_0 expr continue \'a,\lexiting scope_1 stmt continue \'a ;,\lexiting scope_2 block { continue \'a ; \"unreachable\"; },\lexiting scope_3 expr if x > 10i { continue \'a ; \"unreachable\"; },\lexiting scope_4 block {\l if y == 0i { break ; \"unreachable\"; }\l y -= 1i;\l \'a: loop { if z == 0i { break ; \"unreachable\"; } z -= 1i; }\l if x > 10i { continue \'a ; \"unreachable\"; }\l}\l"]; N52 -> N53; N53 -> N54; N50 -> N55; diff --git a/src/test/run-make/graphviz-flowgraph/f25.rs b/src/test/run-make/graphviz-flowgraph/f25.rs index 2ee2e48fd10e0..933f95f228cd9 100644 --- a/src/test/run-make/graphviz-flowgraph/f25.rs +++ b/src/test/run-make/graphviz-flowgraph/f25.rs @@ -10,24 +10,24 @@ #[allow(unreachable_code)] pub fn expr_while_25() { - let mut x = 25; - let mut y = 25; - let mut z = 25; + let mut x = 25i; + let mut y = 25i; + let mut z = 25i; 'a: loop { - if x == 0 { break; "unreachable"; } - x -= 1; + if x == 0i { break; "unreachable"; } + x -= 1i; 'a: loop { - if y == 0 { break; "unreachable"; } - y -= 1; + if y == 0i { break; "unreachable"; } + y -= 1i; 'a: loop { - if z == 0 { break; "unreachable"; } - z -= 1; + if z == 0i { break; "unreachable"; } + z -= 1i; } - if x > 10 { + if x > 10i { continue 'a; "unreachable"; } diff --git a/src/test/run-make/static-unwinding/main.rs b/src/test/run-make/static-unwinding/main.rs index 08777490f212b..9fe78cc2553e7 100644 --- a/src/test/run-make/static-unwinding/main.rs +++ b/src/test/run-make/static-unwinding/main.rs @@ -25,7 +25,7 @@ fn main() { task::try(proc() { let _a = A; lib::callback(|| fail!()); - 1 + 1i }); unsafe { diff --git a/src/test/run-pass/auto-instantiate.rs b/src/test/run-pass/auto-instantiate.rs index f1fe1e945870a..5167764dd2860 100644 --- a/src/test/run-pass/auto-instantiate.rs +++ b/src/test/run-pass/auto-instantiate.rs @@ -16,6 +16,6 @@ struct Triple { x: int, y: int, z: int } fn f(x: T, y: U) -> Pair { return Pair {a: x, b: y}; } pub fn main() { - println!("{:?}", f(Triple {x: 3, y: 4, z: 5}, 4).a.x); + println!("{:?}", f(Triple {x: 3, y: 4, z: 5}, 4i).a.x); println!("{:?}", f(5i, 6i).a); } diff --git a/src/test/run-pass/builtin-superkinds-self-type.rs b/src/test/run-pass/builtin-superkinds-self-type.rs index d0ccfe0e21d6b..1c156f6551c8d 100644 --- a/src/test/run-pass/builtin-superkinds-self-type.rs +++ b/src/test/run-pass/builtin-superkinds-self-type.rs @@ -21,6 +21,6 @@ impl Foo for T { } pub fn main() { let (tx, rx) = channel(); - 1193182.foo(tx); - assert!(rx.recv() == 1193182); + 1193182i.foo(tx); + assert!(rx.recv() == 1193182i); } diff --git a/src/test/run-pass/class-poly-methods.rs b/src/test/run-pass/class-poly-methods.rs index 4f94673a2c027..d94547a4ddac6 100644 --- a/src/test/run-pass/class-poly-methods.rs +++ b/src/test/run-pass/class-poly-methods.rs @@ -36,7 +36,7 @@ pub fn main() { let mut kitty = cat(1000u, 2, vec!("tabby".to_string())); assert_eq!(nyan.how_hungry, 99); assert_eq!(kitty.how_hungry, 2); - nyan.speak(vec!(1,2,3)); + nyan.speak(vec!(1i,2,3)); assert_eq!(nyan.meow_count(), 55u); kitty.speak(vec!("meow".to_string(), "mew".to_string(), "purr".to_string(), "chirp".to_string())); assert_eq!(kitty.meow_count(), 1004u); diff --git a/src/test/run-pass/cleanup-rvalue-scopes.rs b/src/test/run-pass/cleanup-rvalue-scopes.rs index 470e16b4888a7..35c6970592565 100644 --- a/src/test/run-pass/cleanup-rvalue-scopes.rs +++ b/src/test/run-pass/cleanup-rvalue-scopes.rs @@ -110,7 +110,7 @@ pub fn main() { end_of_block!(ref _x, AddFlags(1)); end_of_block!(AddFlags { bits: ref _x }, AddFlags(1)); end_of_block!(&AddFlags { bits }, &AddFlags(1)); - end_of_block!((_, ref _y), (AddFlags(1), 22)); + end_of_block!((_, ref _y), (AddFlags(1), 22i)); end_of_block!(box ref _x, box AddFlags(1)); end_of_block!(box _x, box AddFlags(1)); end_of_block!(_, { { check_flags(0); &AddFlags(1) } }); @@ -120,7 +120,7 @@ pub fn main() { // LHS does not create a ref binding, so temporary lives as long // as statement, and we do not move the AddFlags out: end_of_stmt!(_, AddFlags(1)); - end_of_stmt!((_, _), (AddFlags(1), 22)); + end_of_stmt!((_, _), (AddFlags(1), 22i)); // `&` operator appears inside an arg to a function, // so it is not prolonged: diff --git a/src/test/run-pass/const-binops.rs b/src/test/run-pass/const-binops.rs index be186a95a77be..c14f430e70983 100644 --- a/src/test/run-pass/const-binops.rs +++ b/src/test/run-pass/const-binops.rs @@ -53,28 +53,28 @@ static V: int = 1 << 3; static W: int = 1024 >> 4; static X: uint = 1024 >> 4; -static Y: bool = 1 == 1; -static Z: bool = 1.0 == 1.0; +static Y: bool = 1i == 1; +static Z: bool = 1.0f64 == 1.0; -static AA: bool = 1 <= 2; -static AB: bool = -1 <= 2; -static AC: bool = 1.0 <= 2.0; +static AA: bool = 1i <= 2; +static AB: bool = -1i <= 2; +static AC: bool = 1.0f64 <= 2.0; -static AD: bool = 1 < 2; -static AE: bool = -1 < 2; -static AF: bool = 1.0 < 2.0; +static AD: bool = 1i < 2; +static AE: bool = -1i < 2; +static AF: bool = 1.0f64 < 2.0; -static AG: bool = 1 != 2; -static AH: bool = -1 != 2; -static AI: bool = 1.0 != 2.0; +static AG: bool = 1i != 2; +static AH: bool = -1i != 2; +static AI: bool = 1.0f64 != 2.0; -static AJ: bool = 2 >= 1; -static AK: bool = 2 >= -2; -static AL: bool = 1.0 >= -2.0; +static AJ: bool = 2i >= 1; +static AK: bool = 2i >= -2; +static AL: bool = 1.0f64 >= -2.0; -static AM: bool = 2 > 1; -static AN: bool = 2 > -2; -static AO: bool = 1.0 > -2.0; +static AM: bool = 2i > 1; +static AN: bool = 2i > -2; +static AO: bool = 1.0f64 > -2.0; pub fn main() { assert_eq!(A, -1); diff --git a/src/test/run-pass/const-bound.rs b/src/test/run-pass/const-bound.rs index 7ca4e25a74d33..08912419b5c9f 100644 --- a/src/test/run-pass/const-bound.rs +++ b/src/test/run-pass/const-bound.rs @@ -23,5 +23,5 @@ pub fn main() { foo(F{field: 42}); foo((1, 2u)); foo(@1);*/ - foo(box 1); + foo(box 1i); } diff --git a/src/test/run-pass/drop-trait-generic.rs b/src/test/run-pass/drop-trait-generic.rs index 4ba3aa70dfcdf..9a93873f53865 100644 --- a/src/test/run-pass/drop-trait-generic.rs +++ b/src/test/run-pass/drop-trait-generic.rs @@ -22,5 +22,5 @@ impl ::std::ops::Drop for S { } pub fn main() { - let _x = S { x: 1 }; + let _x = S { x: 1i }; } diff --git a/src/test/run-pass/early-ret-binop-add.rs b/src/test/run-pass/early-ret-binop-add.rs index 97e873e9aff95..b9efdeb3bedf5 100644 --- a/src/test/run-pass/early-ret-binop-add.rs +++ b/src/test/run-pass/early-ret-binop-add.rs @@ -8,5 +8,5 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn wsucc(n: int) -> int { 0 + { return n + 1 } } +fn wsucc(n: int) -> int { 0i + { return n + 1 } } pub fn main() { } diff --git a/src/test/run-pass/else-if.rs b/src/test/run-pass/else-if.rs index 476d3f42d6ee3..63f32ae702b17 100644 --- a/src/test/run-pass/else-if.rs +++ b/src/test/run-pass/else-if.rs @@ -11,20 +11,20 @@ pub fn main() { - if 1 == 2 { + if 1i == 2 { assert!((false)); - } else if 2 == 3 { + } else if 2i == 3 { assert!((false)); - } else if 3 == 4 { assert!((false)); } else { assert!((true)); } - if 1 == 2 { assert!((false)); } else if 2 == 2 { assert!((true)); } - if 1 == 2 { + } else if 3i == 4 { assert!((false)); } else { assert!((true)); } + if 1i == 2 { assert!((false)); } else if 2i == 2 { assert!((true)); } + if 1i == 2 { assert!((false)); - } else if 2 == 2 { - if 1 == 1 { + } else if 2i == 2 { + if 1i == 1 { assert!((true)); - } else { if 2 == 1 { assert!((false)); } else { assert!((false)); } } + } else { if 2i == 1 { assert!((false)); } else { assert!((false)); } } } - if 1 == 2 { + if 1i == 2 { assert!((false)); - } else { if 1 == 2 { assert!((false)); } else { assert!((true)); } } + } else { if 1i == 2 { assert!((false)); } else { assert!((true)); } } } diff --git a/src/test/run-pass/enum-discr.rs b/src/test/run-pass/enum-discr.rs index 1d7ec0aa1bc37..5fe8bb27e1549 100644 --- a/src/test/run-pass/enum-discr.rs +++ b/src/test/run-pass/enum-discr.rs @@ -9,10 +9,10 @@ // except according to those terms. enum Animal { - Cat = 0u, - Dog = 1u, - Horse = 2u, - Snake = 3u + Cat = 0, + Dog = 1, + Horse = 2, + Snake = 3, } enum Hero { diff --git a/src/test/run-pass/enum-discrim-width-stuff.rs b/src/test/run-pass/enum-discrim-width-stuff.rs index 814e2cca97cc7..ccbc5d12191e8 100644 --- a/src/test/run-pass/enum-discrim-width-stuff.rs +++ b/src/test/run-pass/enum-discrim-width-stuff.rs @@ -23,8 +23,8 @@ macro_rules! check { static C: E = V; pub fn check() { assert_eq!(size_of::(), size_of::<$t>()); - assert_eq!(V as $t, $v); - assert_eq!(C as $t, $v); + assert_eq!(V as $t, $v as $t); + assert_eq!(C as $t, $v as $t); assert_eq!(format!("{:?}", V), "V".to_string()); assert_eq!(format!("{:?}", C), "V".to_string()); } @@ -40,8 +40,6 @@ pub fn main() { check!(d, u16, 0xe8d8); check!(e, u32, 0x17273747); check!(f, u32, 0xe8d8c8b8); - check!(g, u64, 0x1727374757677787u64); - check!(h, u64, 0xe8d8c8b8a8988878u64); check!(z, i8, 0x17); check!(y, i8, -0x17); @@ -49,8 +47,6 @@ pub fn main() { check!(w, i16, -0x1727); check!(v, i32, 0x17273747); check!(u, i32, -0x17273747); - check!(t, i64, 0x1727374757677787); - check!(s, i64, -0x1727374757677787); enum Simple { A, B } assert_eq!(::std::mem::size_of::(), 1); diff --git a/src/test/run-pass/enum-nullable-simplifycfg-misopt.rs b/src/test/run-pass/enum-nullable-simplifycfg-misopt.rs index 4ddff8d899afe..da35ffb52959b 100644 --- a/src/test/run-pass/enum-nullable-simplifycfg-misopt.rs +++ b/src/test/run-pass/enum-nullable-simplifycfg-misopt.rs @@ -20,8 +20,8 @@ use std::gc::{Gc, GC}; enum List { Nil, Cons(X, Gc>) } pub fn main() { - match Cons(10, box(GC) Nil) { - Cons(10, _) => {} + match Cons(10i, box(GC) Nil) { + Cons(10i, _) => {} Nil => {} _ => fail!() } diff --git a/src/test/run-pass/enum-vec-initializer.rs b/src/test/run-pass/enum-vec-initializer.rs index a55b5eebefbae..b04f5e11042c8 100644 --- a/src/test/run-pass/enum-vec-initializer.rs +++ b/src/test/run-pass/enum-vec-initializer.rs @@ -16,9 +16,9 @@ static BAR:uint = Bunny as uint; static BAR2:uint = BAR; pub fn main() { - let _v = [0, .. Bunny as uint]; - let _v = [0, .. BAR]; - let _v = [0, .. BAR2]; + let _v = [0i, .. Bunny as uint]; + let _v = [0i, .. BAR]; + let _v = [0i, .. BAR2]; static BAR3:uint = BAR2; - let _v = [0, .. BAR3]; + let _v = [0i, .. BAR3]; } diff --git a/src/test/run-pass/expr-block-box.rs b/src/test/run-pass/expr-block-box.rs index b9d005d945fb1..5652cdea8790e 100644 --- a/src/test/run-pass/expr-block-box.rs +++ b/src/test/run-pass/expr-block-box.rs @@ -12,4 +12,4 @@ use std::gc::GC; -pub fn main() { let x = { box(GC) 100 }; assert!((*x == 100)); } +pub fn main() { let x = { box(GC) 100i }; assert!((*x == 100)); } diff --git a/src/test/run-pass/expr-block-ref.rs b/src/test/run-pass/expr-block-ref.rs index df7ea0c943b38..050ecebb2a1a9 100644 --- a/src/test/run-pass/expr-block-ref.rs +++ b/src/test/run-pass/expr-block-ref.rs @@ -13,4 +13,4 @@ use std::gc::GC; // Regression test for issue #388 -pub fn main() { let _x = { { box(GC) 10 } }; } +pub fn main() { let _x = { { box(GC) 10i } }; } diff --git a/src/test/run-pass/expr-block-unique.rs b/src/test/run-pass/expr-block-unique.rs index 12777bce710b5..0dff989002f5b 100644 --- a/src/test/run-pass/expr-block-unique.rs +++ b/src/test/run-pass/expr-block-unique.rs @@ -11,4 +11,4 @@ -pub fn main() { let x = { box 100 }; assert!((*x == 100)); } +pub fn main() { let x = { box 100i }; assert!((*x == 100)); } diff --git a/src/test/run-pass/expr-empty-ret.rs b/src/test/run-pass/expr-empty-ret.rs index afc7dfaf9b441..7b08251967e32 100644 --- a/src/test/run-pass/expr-empty-ret.rs +++ b/src/test/run-pass/expr-empty-ret.rs @@ -12,7 +12,7 @@ fn f() { let _x = match true { - true => { 10 } + true => { 10i } false => { return } }; } diff --git a/src/test/run-pass/expr-if-fail-all.rs b/src/test/run-pass/expr-if-fail-all.rs index a34620d2e1be4..8e56011e6dcec 100644 --- a/src/test/run-pass/expr-if-fail-all.rs +++ b/src/test/run-pass/expr-if-fail-all.rs @@ -12,7 +12,7 @@ // expression results in fail. pub fn main() { let _x = if true { - 10 + 10i } else { if true { fail!() } else { fail!() } }; diff --git a/src/test/run-pass/expr-if-fail.rs b/src/test/run-pass/expr-if-fail.rs index 023ba508ae5f3..e9f116fcdd425 100644 --- a/src/test/run-pass/expr-if-fail.rs +++ b/src/test/run-pass/expr-if-fail.rs @@ -8,7 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn test_if_fail() { let x = if false { fail!() } else { 10 }; assert!((x == 10)); } +fn test_if_fail() { + let x = if false { fail!() } else { 10i }; + assert!((x == 10)); +} fn test_else_fail() { let x = if true { 10i } else { fail!() }; @@ -16,7 +19,7 @@ fn test_else_fail() { } fn test_elseif_fail() { - let x = if false { 0 } else if false { fail!() } else { 10i }; + let x = if false { 0i } else if false { fail!() } else { 10i }; assert_eq!(x, 10i); } diff --git a/src/test/run-pass/expr-match-fail-all.rs b/src/test/run-pass/expr-match-fail-all.rs index 5c83e81d8be2c..0d23098d8fc77 100644 --- a/src/test/run-pass/expr-match-fail-all.rs +++ b/src/test/run-pass/expr-match-fail-all.rs @@ -16,7 +16,7 @@ pub fn main() { let _x = match true { - true => { 10 } + true => { 10i } false => { match true { true => { fail!() } false => { fail!() } } } }; } diff --git a/src/test/run-pass/floatlits.rs b/src/test/run-pass/floatlits.rs index d1300e7f30c04..09df423d2dadc 100644 --- a/src/test/run-pass/floatlits.rs +++ b/src/test/run-pass/floatlits.rs @@ -11,10 +11,10 @@ pub fn main() { - let f = 4.999999999999; - assert!((f > 4.90)); - assert!((f < 5.0)); - let g = 4.90000000001e-10; - assert!((g > 5e-11)); - assert!((g < 5e-9)); + let f = 4.999999999999f64; + assert!((f > 4.90f64)); + assert!((f < 5.0f64)); + let g = 4.90000000001e-10f64; + assert!((g > 5e-11f64)); + assert!((g < 5e-9f64)); } diff --git a/src/test/run-pass/fn-type-infer.rs b/src/test/run-pass/fn-type-infer.rs index 34417891197a4..80d3527736f40 100644 --- a/src/test/run-pass/fn-type-infer.rs +++ b/src/test/run-pass/fn-type-infer.rs @@ -13,6 +13,6 @@ pub fn main() { // We should be able to type infer inside of ||s. let _f = || { - let i = 10; + let i = 10i; }; } diff --git a/src/test/run-pass/foreach-external-iterators-break.rs b/src/test/run-pass/foreach-external-iterators-break.rs index 87ed7826fed57..d9d3e32026097 100644 --- a/src/test/run-pass/foreach-external-iterators-break.rs +++ b/src/test/run-pass/foreach-external-iterators-break.rs @@ -9,8 +9,8 @@ // except according to those terms. pub fn main() { - let x = [1,..100]; - let mut y = 0; + let x = [1i,..100]; + let mut y = 0i; for i in x.iter() { if y > 10 { break; diff --git a/src/test/run-pass/foreach-external-iterators-nested.rs b/src/test/run-pass/foreach-external-iterators-nested.rs index 78aba778421b1..f4d38dfcfc329 100644 --- a/src/test/run-pass/foreach-external-iterators-nested.rs +++ b/src/test/run-pass/foreach-external-iterators-nested.rs @@ -9,10 +9,10 @@ // except according to those terms. pub fn main() { - let x = [1,..100]; - let y = [2,..100]; - let mut p = 0; - let mut q = 0; + let x = [1i,..100]; + let y = [2i,..100]; + let mut p = 0i; + let mut q = 0i; for i in x.iter() { for j in y.iter() { p += *j; diff --git a/src/test/run-pass/foreach-external-iterators.rs b/src/test/run-pass/foreach-external-iterators.rs index 593a996d8dfe9..684a9b81fb256 100644 --- a/src/test/run-pass/foreach-external-iterators.rs +++ b/src/test/run-pass/foreach-external-iterators.rs @@ -9,8 +9,8 @@ // except according to those terms. pub fn main() { - let x = [1,..100]; - let mut y = 0; + let x = [1i,..100]; + let mut y = 0i; for i in x.iter() { y += *i } diff --git a/src/test/run-pass/foreign-call-no-runtime.rs b/src/test/run-pass/foreign-call-no-runtime.rs index 21238e68b3143..9dd52dfb6da0e 100644 --- a/src/test/run-pass/foreign-call-no-runtime.rs +++ b/src/test/run-pass/foreign-call-no-runtime.rs @@ -22,7 +22,7 @@ extern { pub fn main() { unsafe { Thread::start(proc() { - let i = &100; + let i = &100i; rust_dbg_call(callback, mem::transmute(i)); }).join(); } @@ -31,6 +31,6 @@ pub fn main() { extern fn callback(data: libc::uintptr_t) { unsafe { let data: *const int = mem::transmute(data); - assert_eq!(*data, 100); + assert_eq!(*data, 100i); } } diff --git a/src/test/run-pass/generic-ivec-leak.rs b/src/test/run-pass/generic-ivec-leak.rs index f879e195292c8..ac97a2aa9e854 100644 --- a/src/test/run-pass/generic-ivec-leak.rs +++ b/src/test/run-pass/generic-ivec-leak.rs @@ -10,4 +10,4 @@ enum wrapper { wrapped(T), } -pub fn main() { let _w = wrapped(vec!(1, 2, 3, 4, 5)); } +pub fn main() { let _w = wrapped(vec!(1i, 2, 3, 4, 5)); } diff --git a/src/test/run-pass/generic-ivec.rs b/src/test/run-pass/generic-ivec.rs index 18d1b7f03a1d0..4402dd35d0965 100644 --- a/src/test/run-pass/generic-ivec.rs +++ b/src/test/run-pass/generic-ivec.rs @@ -13,4 +13,4 @@ use std::gc::{Gc, GC}; fn f(_v: Gc) { } -pub fn main() { f(box(GC) vec!(1, 2, 3, 4, 5)); } +pub fn main() { f(box(GC) vec!(1i, 2, 3, 4, 5)); } diff --git a/src/test/run-pass/generic-tag-local.rs b/src/test/run-pass/generic-tag-local.rs index fb8140790e3e9..7d011e57671de 100644 --- a/src/test/run-pass/generic-tag-local.rs +++ b/src/test/run-pass/generic-tag-local.rs @@ -12,4 +12,4 @@ enum clam { a(T), } -pub fn main() { let _c = a(3); } +pub fn main() { let _c = a(3i); } diff --git a/src/test/run-pass/guards.rs b/src/test/run-pass/guards.rs index 450620767e301..5bfbe4bf5a01d 100644 --- a/src/test/run-pass/guards.rs +++ b/src/test/run-pass/guards.rs @@ -12,14 +12,14 @@ struct Pair { x: int, y: int } pub fn main() { let a: int = - match 10 { x if x < 7 => { 1 } x if x < 11 => { 2 } 10 => { 3 } _ => { 4 } }; + match 10i { x if x < 7 => { 1i } x if x < 11 => { 2i } 10 => { 3i } _ => { 4i } }; assert_eq!(a, 2); let b: int = match (Pair {x: 10, y: 20}) { - x if x.x < 5 && x.y < 5 => { 1 } - Pair {x: x, y: y} if x == 10 && y == 20 => { 2 } - Pair {x: _x, y: _y} => { 3 } + x if x.x < 5 && x.y < 5 => { 1i } + Pair {x: x, y: y} if x == 10 && y == 20 => { 2i } + Pair {x: _x, y: _y} => { 3i } }; assert_eq!(b, 2); } diff --git a/src/test/run-pass/hygiene-dodging-1.rs b/src/test/run-pass/hygiene-dodging-1.rs index 3969394a26b93..eb81f82a146f7 100644 --- a/src/test/run-pass/hygiene-dodging-1.rs +++ b/src/test/run-pass/hygiene-dodging-1.rs @@ -14,7 +14,7 @@ mod x { pub fn main(){ // should *not* shadow the module x: - let x = 9; + let x = 9i; // use it to avoid warnings: x+3; assert_eq!(x::g(),14); diff --git a/src/test/run-pass/ignore-all-the-things.rs b/src/test/run-pass/ignore-all-the-things.rs index b176254a878bf..27c63d425bf38 100644 --- a/src/test/run-pass/ignore-all-the-things.rs +++ b/src/test/run-pass/ignore-all-the-things.rs @@ -21,28 +21,28 @@ pub fn main() { //let (a, b, ..) = (5, 5, 5, 5); //let (.., c, d) = (5, 5, 5, 5); let Bar{b: b, ..} = Bar{a: 5, b: 5, c: 5, d: 5}; - match [5, 5, 5, 5] { + match [5i, 5, 5, 5] { [..] => { } } - match [5, 5, 5, 5] { + match [5i, 5, 5, 5] { [a, ..] => { } } - match [5, 5, 5, 5] { + match [5i, 5, 5, 5] { [.., b] => { } } - match [5, 5, 5, 5] { + match [5i, 5, 5, 5] { [a, .., b] => { } } - match [5, 5, 5] { + match [5i, 5, 5] { [..] => { } } - match [5, 5, 5] { + match [5i, 5, 5] { [a, ..] => { } } - match [5, 5, 5] { + match [5i, 5, 5] { [.., a] => { } } - match [5, 5, 5] { + match [5i, 5, 5] { [a, .., b] => { } } } diff --git a/src/test/run-pass/import-in-block.rs b/src/test/run-pass/import-in-block.rs index 24196c225719a..19300569d2050 100644 --- a/src/test/run-pass/import-in-block.rs +++ b/src/test/run-pass/import-in-block.rs @@ -12,11 +12,11 @@ pub fn main() { use std::mem::replace; - let mut x = 5; + let mut x = 5i; replace(&mut x, 6); { use std::mem::*; - let mut y = 6; + let mut y = 6i; swap(&mut x, &mut y); } } diff --git a/src/test/run-pass/import4.rs b/src/test/run-pass/import4.rs index 44f6b6140fbff..0639d7320896b 100644 --- a/src/test/run-pass/import4.rs +++ b/src/test/run-pass/import4.rs @@ -16,4 +16,4 @@ mod zed { pub fn bar() { println!("bar"); } } -pub fn main() { let _zed = 42; bar(); } +pub fn main() { let _zed = 42i; bar(); } diff --git a/src/test/run-pass/inferred-suffix-in-pattern-range.rs b/src/test/run-pass/inferred-suffix-in-pattern-range.rs index b2b16c4ef8420..a7b2a46f0c3a4 100644 --- a/src/test/run-pass/inferred-suffix-in-pattern-range.rs +++ b/src/test/run-pass/inferred-suffix-in-pattern-range.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let x = 2; + let x = 2i; let x_message = match x { 0 .. 1 => { "not many".to_string() } _ => { "lots".to_string() } diff --git a/src/test/run-pass/init-res-into-things.rs b/src/test/run-pass/init-res-into-things.rs index 5e0aeeb6bed76..5d4f6458cf9bc 100644 --- a/src/test/run-pass/init-res-into-things.rs +++ b/src/test/run-pass/init-res-into-things.rs @@ -36,7 +36,7 @@ fn r(i: Gc>) -> r { } fn test_box() { - let i = box(GC) Cell::new(0); + let i = box(GC) Cell::new(0i); { let _a = box(GC) r(i); } @@ -44,7 +44,7 @@ fn test_box() { } fn test_rec() { - let i = box(GC) Cell::new(0); + let i = box(GC) Cell::new(0i); { let _a = Box {x: r(i)}; } @@ -56,7 +56,7 @@ fn test_tag() { t0(r), } - let i = box(GC) Cell::new(0); + let i = box(GC) Cell::new(0i); { let _a = t0(r(i)); } @@ -64,15 +64,15 @@ fn test_tag() { } fn test_tup() { - let i = box(GC) Cell::new(0); + let i = box(GC) Cell::new(0i); { - let _a = (r(i), 0); + let _a = (r(i), 0i); } assert_eq!(i.get(), 1); } fn test_unique() { - let i = box(GC) Cell::new(0); + let i = box(GC) Cell::new(0i); { let _a = box r(i); } @@ -80,7 +80,7 @@ fn test_unique() { } fn test_box_rec() { - let i = box(GC) Cell::new(0); + let i = box(GC) Cell::new(0i); { let _a = box(GC) Box { x: r(i) diff --git a/src/test/run-pass/issue-10638.rs b/src/test/run-pass/issue-10638.rs index bc77b4c534311..a4ef77df31125 100644 --- a/src/test/run-pass/issue-10638.rs +++ b/src/test/run-pass/issue-10638.rs @@ -13,6 +13,6 @@ pub fn main() { ////////////////// still not a doc comment /////**** nope, me neither */ /*** And neither am I! */ - 5; + 5i; /*****! certainly not I */ } diff --git a/src/test/run-pass/issue-1257.rs b/src/test/run-pass/issue-1257.rs index 7d5bd9d6a74db..ad3a050dde9e9 100644 --- a/src/test/run-pass/issue-1257.rs +++ b/src/test/run-pass/issue-1257.rs @@ -10,7 +10,7 @@ pub fn main () { let mut line = "".to_string(); - let mut i = 0; + let mut i = 0i; while line != "exit".to_string() { line = if i == 9 { "exit".to_string() } else { "notexit".to_string() }; i += 1; diff --git a/src/test/run-pass/issue-13027.rs b/src/test/run-pass/issue-13027.rs index 8acaa889a0490..e1634e44847ee 100644 --- a/src/test/run-pass/issue-13027.rs +++ b/src/test/run-pass/issue-13027.rs @@ -27,80 +27,80 @@ pub fn main() { } fn lit_shadow_range() { - assert_eq!(2i, match 1 { - 1 if false => 1, + assert_eq!(2i, match 1i { + 1 if false => 1i, 1..2 => 2, _ => 3 }); let x = 0i; assert_eq!(2i, match x+1 { - 0 => 0, + 0 => 0i, 1 if false => 1, 1..2 => 2, _ => 3 }); assert_eq!(2i, match val() { - 1 if false => 1, + 1 if false => 1i, 1..2 => 2, _ => 3 }); assert_eq!(2i, match CONST { - 0 => 0, + 0 => 0i, 1 if false => 1, 1..2 => 2, _ => 3 }); // value is out of the range of second arm, should match wildcard pattern - assert_eq!(3i, match 3 { - 1 if false => 1, + assert_eq!(3i, match 3i { + 1 if false => 1i, 1..2 => 2, _ => 3 }); } fn range_shadow_lit() { - assert_eq!(2i, match 1 { - 1..2 if false => 1, + assert_eq!(2i, match 1i { + 1..2 if false => 1i, 1 => 2, _ => 3 }); let x = 0i; assert_eq!(2i, match x+1 { - 0 => 0, + 0 => 0i, 1..2 if false => 1, 1 => 2, _ => 3 }); assert_eq!(2i, match val() { - 1..2 if false => 1, + 1..2 if false => 1i, 1 => 2, _ => 3 }); assert_eq!(2i, match CONST { - 0 => 0, + 0 => 0i, 1..2 if false => 1, 1 => 2, _ => 3 }); // ditto - assert_eq!(3i, match 3 { - 1..2 if false => 1, + assert_eq!(3i, match 3i { + 1..2 if false => 1i, 1 => 2, _ => 3 }); } fn range_shadow_range() { - assert_eq!(2i, match 1 { - 0..2 if false => 1, + assert_eq!(2i, match 1i { + 0..2 if false => 1i, 1..3 => 2, _ => 3, }); @@ -127,16 +127,16 @@ fn range_shadow_range() { }); // ditto - assert_eq!(3i, match 5 { - 0..2 if false => 1, + assert_eq!(3i, match 5i { + 0..2 if false => 1i, 1..3 => 2, _ => 3, }); } fn multi_pats_shadow_lit() { - assert_eq!(2i, match 1 { - 100 => 0, + assert_eq!(2i, match 1i { + 100 => 0i, 0 | 1..10 if false => 1, 1 => 2, _ => 3, @@ -144,8 +144,8 @@ fn multi_pats_shadow_lit() { } fn multi_pats_shadow_range() { - assert_eq!(2i, match 1 { - 100 => 0, + assert_eq!(2i, match 1i { + 100 => 0i, 0 | 1..10 if false => 1, 1..3 => 2, _ => 3, @@ -153,8 +153,8 @@ fn multi_pats_shadow_range() { } fn lit_shadow_multi_pats() { - assert_eq!(2i, match 1 { - 100 => 0, + assert_eq!(2i, match 1i { + 100 => 0i, 1 if false => 1, 0 | 1..10 => 2, _ => 3, @@ -162,8 +162,8 @@ fn lit_shadow_multi_pats() { } fn range_shadow_multi_pats() { - assert_eq!(2i, match 1 { - 100 => 0, + assert_eq!(2i, match 1i { + 100 => 0i, 1..3 if false => 1, 0 | 1..10 => 2, _ => 3, @@ -182,5 +182,5 @@ fn misc() { [Bar(_, pred)] if !pred => 2i, _ => 0i, }; - assert_eq!(2, r); + assert_eq!(2i, r); } diff --git a/src/test/run-pass/issue-13494.rs b/src/test/run-pass/issue-13494.rs index 528e6d43cef73..d8f8b979ad063 100644 --- a/src/test/run-pass/issue-13494.rs +++ b/src/test/run-pass/issue-13494.rs @@ -29,9 +29,9 @@ fn helper(rx: Receiver>) { fn test() { let (tx, rx) = channel(); spawn(proc() { helper(rx) }); - let (snd, rcv) = channel(); + let (snd, rcv) = channel::(); for _ in range(1i, 100000i) { - snd.send(1); + snd.send(1i); let (tx2, rx2) = channel(); tx.send(tx2); select! { diff --git a/src/test/run-pass/issue-1460.rs b/src/test/run-pass/issue-1460.rs index 44465fe5f80ee..8176262abd918 100644 --- a/src/test/run-pass/issue-1460.rs +++ b/src/test/run-pass/issue-1460.rs @@ -10,5 +10,5 @@ pub fn main() { - {|i| if 1 == i { }}; + {|i| if 1i == i { }}; } diff --git a/src/test/run-pass/issue-15221.rs b/src/test/run-pass/issue-15221.rs index e5cfccac13a88..378fd4a222e38 100644 --- a/src/test/run-pass/issue-15221.rs +++ b/src/test/run-pass/issue-15221.rs @@ -17,7 +17,7 @@ macro_rules! outer ( ($e:pat ) => (inner!($e))) fn main() { - let outer!(g1) = 13; + let outer!(g1) = 13i; g1; } diff --git a/src/test/run-pass/issue-2216.rs b/src/test/run-pass/issue-2216.rs index 7276b11b1816c..d9d4120d4f405 100644 --- a/src/test/run-pass/issue-2216.rs +++ b/src/test/run-pass/issue-2216.rs @@ -16,7 +16,7 @@ pub fn main() { 'foo: loop { 'bar: loop { 'quux: loop { - if 1 == 2 { + if 1i == 2 { break 'foo; } else { diff --git a/src/test/run-pass/issue-2383.rs b/src/test/run-pass/issue-2383.rs index 5cdda4e5548c3..41cf3eaf7e31a 100644 --- a/src/test/run-pass/issue-2383.rs +++ b/src/test/run-pass/issue-2383.rs @@ -15,5 +15,5 @@ use std::collections::Deque; pub fn main() { let mut q = RingBuf::new(); - q.push_back(10); + q.push_back(10i); } diff --git a/src/test/run-pass/issue-2428.rs b/src/test/run-pass/issue-2428.rs index 4e73be8d84e3a..8c8b9d5df1359 100644 --- a/src/test/run-pass/issue-2428.rs +++ b/src/test/run-pass/issue-2428.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let _foo = 100; + let _foo = 100i; static quux: int = 5; enum Stuff { diff --git a/src/test/run-pass/issue-2734.rs b/src/test/run-pass/issue-2734.rs index e331173a1589d..11ebf014bc65e 100644 --- a/src/test/run-pass/issue-2734.rs +++ b/src/test/run-pass/issue-2734.rs @@ -21,5 +21,5 @@ fn deadcode() { } pub fn main() { - let _ = perform_hax(box 42); + let _ = perform_hax(box 42i); } diff --git a/src/test/run-pass/issue-2735.rs b/src/test/run-pass/issue-2735.rs index 622b35b93aead..1a5b175cffcee 100644 --- a/src/test/run-pass/issue-2735.rs +++ b/src/test/run-pass/issue-2735.rs @@ -21,5 +21,5 @@ fn deadcode() { } pub fn main() { - perform_hax(box 42); + perform_hax(box 42i); } diff --git a/src/test/run-pass/issue-333.rs b/src/test/run-pass/issue-333.rs index 1217f32826f6d..ef49d0a170f88 100644 --- a/src/test/run-pass/issue-333.rs +++ b/src/test/run-pass/issue-333.rs @@ -12,4 +12,4 @@ fn quux(x: T) -> T { let f = id::; return f(x); } fn id(x: T) -> T { return x; } -pub fn main() { assert!((quux(10) == 10)); } +pub fn main() { assert!((quux(10i) == 10i)); } diff --git a/src/test/run-pass/issue-3500.rs b/src/test/run-pass/issue-3500.rs index 99def5476f9a0..eb422c9a8b99b 100644 --- a/src/test/run-pass/issue-3500.rs +++ b/src/test/run-pass/issue-3500.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let x = &Some(1); + let x = &Some(1i); match x { &Some(_) => (), &None => (), diff --git a/src/test/run-pass/issue-3878.rs b/src/test/run-pass/issue-3878.rs index 1b09889c887fb..063b2d7030147 100644 --- a/src/test/run-pass/issue-3878.rs +++ b/src/test/run-pass/issue-3878.rs @@ -11,6 +11,6 @@ #![allow(path_statement)] pub fn main() { - let y = box 1; + let y = box 1i; y; } diff --git a/src/test/run-pass/issue-4387.rs b/src/test/run-pass/issue-4387.rs index f2973256199fa..447bf3b4b267e 100644 --- a/src/test/run-pass/issue-4387.rs +++ b/src/test/run-pass/issue-4387.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn main() { - let _foo = [0, ..2*4]; + let _foo = [0i, ..2*4]; } diff --git a/src/test/run-pass/issue-6117.rs b/src/test/run-pass/issue-6117.rs index 80727b569dea9..e1ecf47e9260b 100644 --- a/src/test/run-pass/issue-6117.rs +++ b/src/test/run-pass/issue-6117.rs @@ -15,7 +15,7 @@ use std::gc::GC; enum Either { Left(T), Right(U) } pub fn main() { - match Left(box(GC) 17) { + match Left(box(GC) 17i) { Right(()) => {} _ => {} } diff --git a/src/test/run-pass/issue-6318.rs b/src/test/run-pass/issue-6318.rs index 4eb005f339725..6512db3b1c58a 100644 --- a/src/test/run-pass/issue-6318.rs +++ b/src/test/run-pass/issue-6318.rs @@ -21,7 +21,7 @@ impl Foo for Struct {} pub fn main() { match A(box Struct as Box) { - A(_a) => 0, + A(_a) => 0i, }; } diff --git a/src/test/run-pass/issue-8044.rs b/src/test/run-pass/issue-8044.rs index 06f41e9cb7a79..e5949e23467b0 100644 --- a/src/test/run-pass/issue-8044.rs +++ b/src/test/run-pass/issue-8044.rs @@ -14,5 +14,5 @@ extern crate minimal = "issue-8044"; use minimal::{BTree, leaf}; pub fn main() { - BTree:: { node: leaf(1) }; + BTree:: { node: leaf(1i) }; } diff --git a/src/test/run-pass/issue-8498.rs b/src/test/run-pass/issue-8498.rs index 770de8f534666..e4f4db6ea63b7 100644 --- a/src/test/run-pass/issue-8498.rs +++ b/src/test/run-pass/issue-8498.rs @@ -9,14 +9,14 @@ // except according to those terms. pub fn main() { - match &[(box 5,box 7)] { + match &[(box 5i,box 7i)] { ps => { let (ref y, _) = ps[0]; assert!(**y == 5); } } - match Some(&[(box 5,)]) { + match Some(&[(box 5i,)]) { Some(ps) => { let (ref y,) = ps[0]; assert!(**y == 5); @@ -24,7 +24,7 @@ pub fn main() { None => () } - match Some(&[(box 5,box 7)]) { + match Some(&[(box 5i,box 7i)]) { Some(ps) => { let (ref y, ref z) = ps[0]; assert!(**y == 5); diff --git a/src/test/run-pass/issue-868.rs b/src/test/run-pass/issue-868.rs index 12dcc4ecd2c3a..99ab83ec62073 100644 --- a/src/test/run-pass/issue-868.rs +++ b/src/test/run-pass/issue-868.rs @@ -11,7 +11,7 @@ fn f(g: || -> T) -> T { g() } pub fn main() { - let _x = f( | | { 10 }); + let _x = f( | | { 10i }); // used to be: cannot determine a type for this expression f(| | { }); // ditto diff --git a/src/test/run-pass/issue-8898.rs b/src/test/run-pass/issue-8898.rs index 84e9de9b924ab..e787962bb813e 100644 --- a/src/test/run-pass/issue-8898.rs +++ b/src/test/run-pass/issue-8898.rs @@ -19,7 +19,7 @@ fn assert_repr_eq(obj : T, expected : String) { } pub fn main() { - let abc = [1, 2, 3]; + let abc = [1i, 2, 3]; let tf = [true, false]; let x = [(), ()]; let slice = x.slice(0,1); diff --git a/src/test/run-pass/issue-8983.rs b/src/test/run-pass/issue-8983.rs index 9f6b281810e31..2fb96f593efa1 100644 --- a/src/test/run-pass/issue-8983.rs +++ b/src/test/run-pass/issue-8983.rs @@ -16,6 +16,6 @@ fn main() { fn f(_: proc()) {} fn eat(_: T) {} - let x = box(GC) 1; + let x = box(GC) 1i; f(proc() { eat(x) }); } diff --git a/src/test/run-pass/issue-9906.rs b/src/test/run-pass/issue-9906.rs index 6b8e250ea74bf..dd12ea8b76523 100644 --- a/src/test/run-pass/issue-9906.rs +++ b/src/test/run-pass/issue-9906.rs @@ -14,5 +14,5 @@ extern crate testmod = "issue-9906"; pub fn main() { testmod::foo(); - testmod::FooBar::new(1); + testmod::FooBar::new(1i); } diff --git a/src/test/run-pass/issue-9942.rs b/src/test/run-pass/issue-9942.rs index 7864f4fbdd66c..aa86f488906e6 100644 --- a/src/test/run-pass/issue-9942.rs +++ b/src/test/run-pass/issue-9942.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn main() { - static S: uint = 23 as uint; [0, ..S]; () + static S: uint = 23 as uint; [0i, ..S]; () } diff --git a/src/test/run-pass/keyword-changes-2012-07-31.rs b/src/test/run-pass/keyword-changes-2012-07-31.rs index ff568b77f08ac..885f266ca3d95 100644 --- a/src/test/run-pass/keyword-changes-2012-07-31.rs +++ b/src/test/run-pass/keyword-changes-2012-07-31.rs @@ -19,7 +19,7 @@ mod foo { } fn bar() -> int { - match 0 { - _ => { 0 } + match 0i { + _ => { 0i } } } diff --git a/src/test/run-pass/lazy-and-or.rs b/src/test/run-pass/lazy-and-or.rs index c4f37ccf88ad3..366b3c41328fd 100644 --- a/src/test/run-pass/lazy-and-or.rs +++ b/src/test/run-pass/lazy-and-or.rs @@ -13,7 +13,7 @@ extern crate debug; fn incr(x: &mut int) -> bool { *x += 1; assert!((false)); return false; } pub fn main() { - let x = 1 == 2 || 3 == 3; + let x = 1i == 2 || 3i == 3; assert!((x)); let mut y: int = 10; println!("{:?}", x || incr(&mut y)); diff --git a/src/test/run-pass/lazy-init.rs b/src/test/run-pass/lazy-init.rs index 60f7689ecfa63..cd8be550d511b 100644 --- a/src/test/run-pass/lazy-init.rs +++ b/src/test/run-pass/lazy-init.rs @@ -12,4 +12,4 @@ fn foo(x: int) { println!("{}", x); } -pub fn main() { let mut x: int; if 1 > 2 { x = 12; } else { x = 10; } foo(x); } +pub fn main() { let mut x: int; if 1i > 2 { x = 12; } else { x = 10; } foo(x); } diff --git a/src/test/run-pass/long-while.rs b/src/test/run-pass/long-while.rs index cbe26844708db..7d30b22867c05 100644 --- a/src/test/run-pass/long-while.rs +++ b/src/test/run-pass/long-while.rs @@ -14,6 +14,6 @@ pub fn main() { let mut i: int = 0; while i < 1000000 { i += 1; - let x = 3; + let x = 3i; } } diff --git a/src/test/run-pass/loop-diverges.rs b/src/test/run-pass/loop-diverges.rs index 9c46ba2cb9bbf..4fe73188b45aa 100644 --- a/src/test/run-pass/loop-diverges.rs +++ b/src/test/run-pass/loop-diverges.rs @@ -16,5 +16,5 @@ fn forever() -> ! { } pub fn main() { - if (1 == 2) { forever(); } + if (1i == 2) { forever(); } } diff --git a/src/test/run-pass/loop-label-shadowing.rs b/src/test/run-pass/loop-label-shadowing.rs index cfe51fe77589f..46d4fa460fe2b 100644 --- a/src/test/run-pass/loop-label-shadowing.rs +++ b/src/test/run-pass/loop-label-shadowing.rs @@ -12,7 +12,7 @@ fn main() { let mut foo = Vec::new(); - 'foo: for i in [1, 2, 3].iter() { + 'foo: for i in [1i, 2, 3].iter() { foo.push(i); } } diff --git a/src/test/run-pass/loop-no-reinit-needed-post-bot.rs b/src/test/run-pass/loop-no-reinit-needed-post-bot.rs index 8b77500225022..14aee4c3be81d 100644 --- a/src/test/run-pass/loop-no-reinit-needed-post-bot.rs +++ b/src/test/run-pass/loop-no-reinit-needed-post-bot.rs @@ -17,7 +17,7 @@ fn my_fail() -> ! { loop {} } pub fn step(f: bool) { let mut g = S; - let mut i = 0; + let mut i = 0i; loop { if i > 10 { break; } else { i += 1; } diff --git a/src/test/run-pass/match-bot-2.rs b/src/test/run-pass/match-bot-2.rs index ba897bd92c017..f3c299bd1f913 100644 --- a/src/test/run-pass/match-bot-2.rs +++ b/src/test/run-pass/match-bot-2.rs @@ -9,5 +9,5 @@ // except according to those terms. // n.b. This was only ever failing with optimization disabled. -fn a() -> int { match return 1 { 2 => 3, _ => fail!() } } +fn a() -> int { match return 1i { 2i => 3i, _ => fail!() } } pub fn main() { a(); } diff --git a/src/test/run-pass/match-naked-record-expr.rs b/src/test/run-pass/match-naked-record-expr.rs index 433cf23626bbf..170a3513a1a35 100644 --- a/src/test/run-pass/match-naked-record-expr.rs +++ b/src/test/run-pass/match-naked-record-expr.rs @@ -11,7 +11,7 @@ struct X { x: int } pub fn main() { - let _x = match 0 { + let _x = match 0i { _ => X { x: 0 }.x diff --git a/src/test/run-pass/match-naked-record.rs b/src/test/run-pass/match-naked-record.rs index fe12b7c158568..21c31b621835e 100644 --- a/src/test/run-pass/match-naked-record.rs +++ b/src/test/run-pass/match-naked-record.rs @@ -11,7 +11,7 @@ struct X { x: int } pub fn main() { - let _x = match 0 { + let _x = match 0i { _ => X { x: 0 } diff --git a/src/test/run-pass/match-pipe-binding.rs b/src/test/run-pass/match-pipe-binding.rs index 52d966a12d71a..2169e996577bf 100644 --- a/src/test/run-pass/match-pipe-binding.rs +++ b/src/test/run-pass/match-pipe-binding.rs @@ -10,7 +10,7 @@ fn test1() { // from issue 6338 - match ((1, "a".to_string()), (2, "b".to_string())) { + match ((1i, "a".to_string()), (2i, "b".to_string())) { ((1, a), (2, b)) | ((2, b), (1, a)) => { assert_eq!(a, "a".to_string()); assert_eq!(b, "b".to_string()); diff --git a/src/test/run-pass/match-range.rs b/src/test/run-pass/match-range.rs index 6b02b21a084bd..7421ae9588407 100644 --- a/src/test/run-pass/match-range.rs +++ b/src/test/run-pass/match-range.rs @@ -26,15 +26,15 @@ pub fn main() { 'a'..'z' => {} _ => fail!("should suppport char ranges") } - match -3 { + match -3i { -7..5 => {} _ => fail!("should match signed range") } - match 3.0 { + match 3.0f64 { 1.0..5.0 => {} _ => fail!("should match float range") } - match -1.5 { + match -1.5f64 { -3.6..3.6 => {} _ => fail!("should match negative float range") } diff --git a/src/test/run-pass/multi-let.rs b/src/test/run-pass/multi-let.rs index eb1444be37844..201abeba07388 100644 --- a/src/test/run-pass/multi-let.rs +++ b/src/test/run-pass/multi-let.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let x = 10; + let x = 10i; let y = x; assert!((y == 10)); } diff --git a/src/test/run-pass/negative.rs b/src/test/run-pass/negative.rs index d92496c4b7b40..148c1c9f0cfaf 100644 --- a/src/test/run-pass/negative.rs +++ b/src/test/run-pass/negative.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - match -5 { + match -5i { -5 => {} _ => { fail!() } } diff --git a/src/test/run-pass/new-box-syntax.rs b/src/test/run-pass/new-box-syntax.rs index 0150120e1dbca..b16bef3fc9902 100644 --- a/src/test/run-pass/new-box-syntax.rs +++ b/src/test/run-pass/new-box-syntax.rs @@ -22,15 +22,15 @@ struct Structure { } pub fn main() { - let x: Box = box(HEAP) 2; - let y: Box = box 2; - let z: Gc = box(GC) 2; + let x: Box = box(HEAP) 2i; + let y: Box = box 2i; + let z: Gc = box(GC) 2i; let a: Gc = box(GC) Structure { x: 10, y: 20, }; - let b: Box = box()(1 + 2); - let c = box()(3 + 4); - let d = box(GC)(5 + 6); + let b: Box = box()(1i + 2); + let c = box()(3i + 4); + let d = box(GC)(5i + 6); } diff --git a/src/test/run-pass/operator-associativity.rs b/src/test/run-pass/operator-associativity.rs index bee6d23a27d62..8d45b8ecb0844 100644 --- a/src/test/run-pass/operator-associativity.rs +++ b/src/test/run-pass/operator-associativity.rs @@ -12,4 +12,4 @@ // Testcase for issue #130, operator associativity. -pub fn main() { assert!((3 * 5 / 2 == 7)); } +pub fn main() { assert!((3i * 5i / 2i == 7i)); } diff --git a/src/test/run-pass/out-of-stack.rs b/src/test/run-pass/out-of-stack.rs index 1566b9ed6f19c..19d1635a9a5e1 100644 --- a/src/test/run-pass/out-of-stack.rs +++ b/src/test/run-pass/out-of-stack.rs @@ -21,7 +21,7 @@ use std::str; pub fn black_box(dummy: T) { unsafe { asm!("" : : "r"(&dummy)) } } fn silent_recurse() { - let buf = [0, ..1000]; + let buf = [0i, ..1000]; black_box(buf); silent_recurse(); } diff --git a/src/test/run-pass/owned-implies-static.rs b/src/test/run-pass/owned-implies-static.rs index d1e9fb270d7bd..498b81d307e29 100644 --- a/src/test/run-pass/owned-implies-static.rs +++ b/src/test/run-pass/owned-implies-static.rs @@ -11,5 +11,5 @@ fn f(_x: T) {} pub fn main() { - f(box 5); + f(box 5i); } diff --git a/src/test/run-pass/paren-free.rs b/src/test/run-pass/paren-free.rs index d9669812d2ad3..569023c443908 100644 --- a/src/test/run-pass/paren-free.rs +++ b/src/test/run-pass/paren-free.rs @@ -10,6 +10,6 @@ pub fn main() { let x = true; - if x { let mut i = 10; while i > 0 { i -= 1; } } + if x { let mut i = 10i; while i > 0 { i -= 1; } } match x { true => { println!("right"); } false => { println!("wrong"); } } } diff --git a/src/test/run-pass/pub-extern-privacy.rs b/src/test/run-pass/pub-extern-privacy.rs index d48f9dccaafc9..16f5a06b88684 100644 --- a/src/test/run-pass/pub-extern-privacy.rs +++ b/src/test/run-pass/pub-extern-privacy.rs @@ -18,6 +18,6 @@ mod a { pub fn main() { unsafe { - a::free(transmute(0)); + a::free(transmute(0u)); } } diff --git a/src/test/run-pass/regions-infer-borrow-scope-view.rs b/src/test/run-pass/regions-infer-borrow-scope-view.rs index 1342c2e77f28f..13200d619d02e 100644 --- a/src/test/run-pass/regions-infer-borrow-scope-view.rs +++ b/src/test/run-pass/regions-infer-borrow-scope-view.rs @@ -12,7 +12,7 @@ fn view<'r, T>(x: &'r [T]) -> &'r [T] {x} pub fn main() { - let v = vec!(1, 2, 3); + let v = vec!(1i, 2, 3); let x = view(v.as_slice()); let y = view(x.as_slice()); assert!((*v.get(0) == x[0]) && (*v.get(0) == y[0])); diff --git a/src/test/run-pass/resource-assign-is-not-copy.rs b/src/test/run-pass/resource-assign-is-not-copy.rs index dc6dac15bb2b1..9dc3b7a0f80e1 100644 --- a/src/test/run-pass/resource-assign-is-not-copy.rs +++ b/src/test/run-pass/resource-assign-is-not-copy.rs @@ -33,11 +33,11 @@ fn r(i: Gc>) -> r { } pub fn main() { - let i = box(GC) Cell::new(0); + let i = box(GC) Cell::new(0i); // Even though these look like copies, they are guaranteed not to be { let a = r(i); - let b = (a, 10); + let b = (a, 10i); let (c, _d) = b; println!("{:?}", c); } diff --git a/src/test/run-pass/self-re-assign.rs b/src/test/run-pass/self-re-assign.rs index e613a83737e4d..75fb98f8e24f9 100644 --- a/src/test/run-pass/self-re-assign.rs +++ b/src/test/run-pass/self-re-assign.rs @@ -14,11 +14,11 @@ use std::rc::Rc; pub fn main() { - let mut x = box 3; + let mut x = box 3i; x = x; assert!(*x == 3); - let mut x = Rc::new(3); + let mut x = Rc::new(3i); x = x; assert!(*x == 3); } diff --git a/src/test/run-pass/shadow.rs b/src/test/run-pass/shadow.rs index a65e44166e9ed..96a12494b2ff2 100644 --- a/src/test/run-pass/shadow.rs +++ b/src/test/run-pass/shadow.rs @@ -19,7 +19,7 @@ fn foo(c: Vec ) { some::(_) => { for _i in c.iter() { println!("{:?}", a); - let a = 17; + let a = 17i; b.push(a); } } @@ -29,4 +29,4 @@ fn foo(c: Vec ) { enum t { none, some(T), } -pub fn main() { let x = 10; let x = x + 20; assert!((x == 30)); foo(Vec::new()); } +pub fn main() { let x = 10i; let x = x + 20; assert!((x == 30)); foo(Vec::new()); } diff --git a/src/test/run-pass/static-assert.rs b/src/test/run-pass/static-assert.rs index f8fd81b936515..c695fa2b72ec1 100644 --- a/src/test/run-pass/static-assert.rs +++ b/src/test/run-pass/static-assert.rs @@ -12,13 +12,13 @@ static b: bool = true; #[static_assert] -static c: bool = 1 == 1; +static c: bool = 1i == 1; #[static_assert] -static d: bool = 1 != 2; +static d: bool = 1i != 2; #[static_assert] -static f: bool = (4/2) == 2; +static f: bool = (4i/2) == 2; pub fn main() { } diff --git a/src/test/run-pass/string-self-append.rs b/src/test/run-pass/string-self-append.rs index 612483f69094d..dc1e23ca09cf4 100644 --- a/src/test/run-pass/string-self-append.rs +++ b/src/test/run-pass/string-self-append.rs @@ -11,7 +11,7 @@ pub fn main() { // Make sure we properly handle repeated self-appends. let mut a: String = "A".to_string(); - let mut i = 20; + let mut i = 20i; let mut expected_len = 1u; while i > 0 { println!("{}", a.len()); diff --git a/src/test/run-pass/supported-cast.rs b/src/test/run-pass/supported-cast.rs index a3ab4637412fc..2757439828dd9 100644 --- a/src/test/run-pass/supported-cast.rs +++ b/src/test/run-pass/supported-cast.rs @@ -11,7 +11,7 @@ extern crate libc; pub fn main() { - let f = 1 as *const libc::FILE; + let f = 1u as *const libc::FILE; println!("{}", f as int); println!("{}", f as uint); println!("{}", f as i8); @@ -34,8 +34,8 @@ pub fn main() { println!("{}", 1 as u16); println!("{}", 1 as u32); println!("{}", 1 as u64); - println!("{}", 1 as f32); - println!("{}", 1 as f64); + println!("{}", 1i as f32); + println!("{}", 1i as f64); println!("{}", 1u as int); println!("{}", 1u as uint); @@ -191,19 +191,6 @@ pub fn main() { println!("{}", true as f32); println!("{}", true as f64); - println!("{}", 1. as int); - println!("{}", 1. as uint); - println!("{}", 1. as i8); - println!("{}", 1. as i16); - println!("{}", 1. as i32); - println!("{}", 1. as i64); - println!("{}", 1. as u8); - println!("{}", 1. as u16); - println!("{}", 1. as u32); - println!("{}", 1. as u64); - println!("{}", 1. as f32); - println!("{}", 1. as f64); - println!("{}", 1f32 as int); println!("{}", 1f32 as uint); println!("{}", 1f32 as i8); diff --git a/src/test/run-pass/swap-1.rs b/src/test/run-pass/swap-1.rs index 82a76512e08f7..9a77356d7ebf6 100644 --- a/src/test/run-pass/swap-1.rs +++ b/src/test/run-pass/swap-1.rs @@ -11,7 +11,7 @@ use std::mem::swap; pub fn main() { - let mut x = 3; let mut y = 7; + let mut x = 3i; let mut y = 7i; swap(&mut x, &mut y); assert!((x == 7)); assert!((y == 3)); } diff --git a/src/test/run-pass/tag-variant-disr-type-mismatch.rs b/src/test/run-pass/tag-variant-disr-type-mismatch.rs index 3d63acd5b8383..c04751d51b4fc 100644 --- a/src/test/run-pass/tag-variant-disr-type-mismatch.rs +++ b/src/test/run-pass/tag-variant-disr-type-mismatch.rs @@ -9,7 +9,7 @@ // except according to those terms. enum color { - red = 1u, + red = 1i, blue = 2, } diff --git a/src/test/run-pass/task-comm-12.rs b/src/test/run-pass/task-comm-12.rs index 851f87adfc20d..f72c0ef8d7b3c 100644 --- a/src/test/run-pass/task-comm-12.rs +++ b/src/test/run-pass/task-comm-12.rs @@ -21,7 +21,7 @@ fn test00() { }); // Sleep long enough for the task to finish. - let mut i = 0; + let mut i = 0u; while i < 10000 { task::deschedule(); i += 1; diff --git a/src/test/run-pass/terminate-in-initializer.rs b/src/test/run-pass/terminate-in-initializer.rs index 391f0e20fccd9..eb0bfc969f396 100644 --- a/src/test/run-pass/terminate-in-initializer.rs +++ b/src/test/run-pass/terminate-in-initializer.rs @@ -18,7 +18,7 @@ use std::gc::{Gc}; fn test_break() { loop { let _x: Gc = break; } } -fn test_cont() { let mut i = 0; while i < 1 { i += 1; let _x: Gc = continue; } } +fn test_cont() { let mut i = 0i; while i < 1 { i += 1; let _x: Gc = continue; } } fn test_ret() { let _x: Gc = return; } diff --git a/src/test/run-pass/trailing-comma.rs b/src/test/run-pass/trailing-comma.rs index 13d79959f81f7..8d580729da980 100644 --- a/src/test/run-pass/trailing-comma.rs +++ b/src/test/run-pass/trailing-comma.rs @@ -11,6 +11,6 @@ fn f(_: int,) {} pub fn main() { - f(0,); - let (_, _,) = (1, 1,); + f(0i,); + let (_, _,) = (1i, 1i,); } diff --git a/src/test/run-pass/trait-default-method-xc-2.rs b/src/test/run-pass/trait-default-method-xc-2.rs index 9e4a7c4be9712..447968eb8c4f8 100644 --- a/src/test/run-pass/trait-default-method-xc-2.rs +++ b/src/test/run-pass/trait-default-method-xc-2.rs @@ -20,8 +20,8 @@ use aux2::{a_struct, welp}; pub fn main () { - let a = a_struct { x: 0 }; - let b = a_struct { x: 1 }; + let a = a_struct { x: 0i }; + let b = a_struct { x: 1i }; assert_eq!(0i.g(), 10); assert_eq!(a.g(), 10); @@ -30,5 +30,5 @@ pub fn main () { assert_eq!(b.h(), 11); assert_eq!(A::lurr(&a, &b), 21); - welp(&0); + welp(&0i); } diff --git a/src/test/run-pass/type-param-constraints.rs b/src/test/run-pass/type-param-constraints.rs index b87517940c266..fd7e749935b23 100644 --- a/src/test/run-pass/type-param-constraints.rs +++ b/src/test/run-pass/type-param-constraints.rs @@ -35,15 +35,15 @@ pub fn main() { p_foo(box(GC) r(10)); p_foo(box r(10)); - p_foo(box(GC) 10); - p_foo(box 10); - p_foo(10); + p_foo(box(GC) 10i); + p_foo(box 10i); + p_foo(10i); s_foo(box(GC) r(10)); - s_foo(box(GC) 10); - s_foo(box 10); - s_foo(10); + s_foo(box(GC) 10i); + s_foo(box 10i); + s_foo(10i); - u_foo(box 10); - u_foo(10); + u_foo(box 10i); + u_foo(10i); } diff --git a/src/test/run-pass/typestate-cfg-nesting.rs b/src/test/run-pass/typestate-cfg-nesting.rs index 37d06bf4f8308..f1e40cc3e587d 100644 --- a/src/test/run-pass/typestate-cfg-nesting.rs +++ b/src/test/run-pass/typestate-cfg-nesting.rs @@ -12,12 +12,12 @@ #![allow(unused_variable)] fn f() { - let x = 10; let mut y = 11; + let x = 10i; let mut y = 11i; if true { match x { _ => { y = x; } } } else { } } pub fn main() { - let x = 10; - let mut y = 11; + let x = 10i; + let mut y = 11i; if true { while false { y = x; } } else { } } diff --git a/src/test/run-pass/typestate-multi-decl.rs b/src/test/run-pass/typestate-multi-decl.rs index 42910c4700581..cbb0dcc8f2b6e 100644 --- a/src/test/run-pass/typestate-multi-decl.rs +++ b/src/test/run-pass/typestate-multi-decl.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let (x, y) = (10, 20); + let (x, y) = (10i, 20i); let z = x + y; assert!((z == 30)); } diff --git a/src/test/run-pass/unify-return-ty.rs b/src/test/run-pass/unify-return-ty.rs index bf74dedebc4fb..a189d4528ae34 100644 --- a/src/test/run-pass/unify-return-ty.rs +++ b/src/test/run-pass/unify-return-ty.rs @@ -16,7 +16,7 @@ use std::mem; fn null() -> *const T { unsafe { - mem::transmute(0) + mem::transmute(0u) } } diff --git a/src/test/run-pass/unique-create.rs b/src/test/run-pass/unique-create.rs index 834b549d4f413..acd405e2659af 100644 --- a/src/test/run-pass/unique-create.rs +++ b/src/test/run-pass/unique-create.rs @@ -9,9 +9,9 @@ // except according to those terms. pub fn main() { - box 100; + box 100i; } fn vec() { - vec!(0); + vec!(0i); } diff --git a/src/test/run-pass/unique-drop-complex.rs b/src/test/run-pass/unique-drop-complex.rs index 01aac804bb64f..a4b6ff5accff2 100644 --- a/src/test/run-pass/unique-drop-complex.rs +++ b/src/test/run-pass/unique-drop-complex.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn main() { - let _x = box vec!(0,0,0,0,0); + let _x = box vec!(0i,0,0,0,0); } diff --git a/src/test/run-pass/unique-init.rs b/src/test/run-pass/unique-init.rs index d7105b472ccc5..6e58ec23a3b03 100644 --- a/src/test/run-pass/unique-init.rs +++ b/src/test/run-pass/unique-init.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn main() { - let _i = box 100; + let _i = box 100i; } diff --git a/src/test/run-pass/unreachable-code.rs b/src/test/run-pass/unreachable-code.rs index 2d74b3163d258..6b6754f34326d 100644 --- a/src/test/run-pass/unreachable-code.rs +++ b/src/test/run-pass/unreachable-code.rs @@ -23,10 +23,10 @@ fn call_id_2() { id(true) && id(return); } fn call_id_3() { id(return) && id(return); } -fn ret_ret() -> int { return (return 2) + 3; } +fn ret_ret() -> int { return (return 2i) + 3i; } fn ret_guard() { - match 2 { + match 2i { x if (return) => { x; } _ => {} } diff --git a/src/test/run-pass/unused-move-capture.rs b/src/test/run-pass/unused-move-capture.rs index 83795e64467e4..ba48ae1c0cef8 100644 --- a/src/test/run-pass/unused-move-capture.rs +++ b/src/test/run-pass/unused-move-capture.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let _x = box 1; + let _x = box 1i; let lam_move: || = || {}; lam_move(); } diff --git a/src/test/run-pass/unused-move.rs b/src/test/run-pass/unused-move.rs index bac9ce814bc27..883ec44bf2eb4 100644 --- a/src/test/run-pass/unused-move.rs +++ b/src/test/run-pass/unused-move.rs @@ -16,6 +16,6 @@ pub fn main() { - let y = box 1; + let y = box 1i; y; } diff --git a/src/test/run-pass/unwind-box.rs b/src/test/run-pass/unwind-box.rs index f06791ff2c7b4..a81f88e2af373 100644 --- a/src/test/run-pass/unwind-box.rs +++ b/src/test/run-pass/unwind-box.rs @@ -14,7 +14,7 @@ use std::task; use std::gc::GC; fn f() { - let _a = box(GC) 0; + let _a = box(GC) 0i; fail!(); } diff --git a/src/test/run-pass/unwind-unique.rs b/src/test/run-pass/unwind-unique.rs index ce2524396184e..e5497427755fd 100644 --- a/src/test/run-pass/unwind-unique.rs +++ b/src/test/run-pass/unwind-unique.rs @@ -11,7 +11,7 @@ use std::task; fn f() { - let _a = box 0; + let _a = box 0i; fail!(); } diff --git a/src/test/run-pass/vec-macro-with-brackets.rs b/src/test/run-pass/vec-macro-with-brackets.rs index 87b18f841ed28..d06e3dc0633fa 100644 --- a/src/test/run-pass/vec-macro-with-brackets.rs +++ b/src/test/run-pass/vec-macro-with-brackets.rs @@ -19,5 +19,5 @@ macro_rules! vec [ ] pub fn main() { - let my_vec = vec![1, 2, 3, 4, 5]; + let my_vec = vec![1i, 2, 3, 4, 5]; } diff --git a/src/test/run-pass/vec-matching.rs b/src/test/run-pass/vec-matching.rs index ac869a10d2e7b..8ba8ba4482edc 100644 --- a/src/test/run-pass/vec-matching.rs +++ b/src/test/run-pass/vec-matching.rs @@ -69,7 +69,7 @@ fn d() { } fn e() { - match &[1, 2, 3] { + match &[1i, 2, 3] { [1, 2] => (), [..] => () } diff --git a/src/test/run-pass/vec-push.rs b/src/test/run-pass/vec-push.rs index 33f01c5bd41c8..fe0f92a0c1119 100644 --- a/src/test/run-pass/vec-push.rs +++ b/src/test/run-pass/vec-push.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn main() { let mut v = vec!(1, 2, 3); v.push(1); } +pub fn main() { let mut v = vec!(1i, 2, 3); v.push(1); } diff --git a/src/test/run-pass/vec-repeat-with-cast.rs b/src/test/run-pass/vec-repeat-with-cast.rs index f5d09e308ba88..18ccd8c96ab6c 100644 --- a/src/test/run-pass/vec-repeat-with-cast.rs +++ b/src/test/run-pass/vec-repeat-with-cast.rs @@ -8,4 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn main() { let _a = [0, ..1 as uint]; } +pub fn main() { let _a = [0i, ..1 as uint]; } diff --git a/src/test/run-pass/weird-exprs.rs b/src/test/run-pass/weird-exprs.rs index 61578578ab6da..bae1a7c45e423 100644 --- a/src/test/run-pass/weird-exprs.rs +++ b/src/test/run-pass/weird-exprs.rs @@ -38,7 +38,7 @@ fn zombiejesus() { while (return) { if (return) { match (return) { - 1 => { + 1i => { if (return) { return } else { @@ -56,7 +56,7 @@ fn zombiejesus() { } fn notsure() { - let mut _x; + let mut _x: int; let mut _y = (_x = 0) == (_x = 0); let mut _z = (_x = 0) < (_x = 0); let _a = (_x += 0) == (_x = 0); @@ -72,8 +72,8 @@ fn canttouchthis() -> uint { fn angrydome() { loop { if break { } } - let mut i = 0; - loop { i += 1; if i == 1 { match (continue) { 1 => { }, _ => fail!("wat") } } + let mut i = 0i; + loop { i += 1; if i == 1 { match (continue) { 1i => { }, _ => fail!("wat") } } break; } } diff --git a/src/test/run-pass/while-flow-graph.rs b/src/test/run-pass/while-flow-graph.rs index 36d902dc2e020..01c5986b130d7 100644 --- a/src/test/run-pass/while-flow-graph.rs +++ b/src/test/run-pass/while-flow-graph.rs @@ -10,4 +10,4 @@ -pub fn main() { let x: int = 10; while x == 10 && x == 11 { let _y = 0xf00; } } +pub fn main() { let x: int = 10; while x == 10 && x == 11 { let _y = 0xf00u; } }