diff --git a/src/test/auxiliary/cci_class_3.rs b/src/test/auxiliary/cci_class_3.rs index 6a57bb36663..98881eb09bf 100644 --- a/src/test/auxiliary/cci_class_3.rs +++ b/src/test/auxiliary/cci_class_3.rs @@ -16,7 +16,7 @@ pub mod kitties { } impl cat { - pub fn speak(&mut self) { self.meows += 1u; } + pub fn speak(&mut self) { self.meows += 1_usize; } pub fn meow_count(&mut self) -> uint { self.meows } } diff --git a/src/test/auxiliary/cci_class_4.rs b/src/test/auxiliary/cci_class_4.rs index 78d667fc5a5..9d7905cdebd 100644 --- a/src/test/auxiliary/cci_class_4.rs +++ b/src/test/auxiliary/cci_class_4.rs @@ -34,8 +34,8 @@ pub mod kitties { impl cat { pub fn meow(&mut self) { println!("Meow"); - self.meows += 1u; - if self.meows % 5u == 0u { + self.meows += 1_usize; + if self.meows % 5_usize == 0_usize { self.how_hungry += 1; } } diff --git a/src/test/auxiliary/cci_class_cast.rs b/src/test/auxiliary/cci_class_cast.rs index 0a888d2bd11..dd272bf639b 100644 --- a/src/test/auxiliary/cci_class_cast.rs +++ b/src/test/auxiliary/cci_class_cast.rs @@ -26,8 +26,8 @@ pub mod kitty { impl cat { fn meow(&mut self) { println!("Meow"); - self.meows += 1u; - if self.meows % 5u == 0u { + self.meows += 1_usize; + if self.meows % 5_usize == 0_usize { self.how_hungry += 1; } } diff --git a/src/test/auxiliary/cci_impl_lib.rs b/src/test/auxiliary/cci_impl_lib.rs index 3b1857f9ccb..6ee497370e8 100644 --- a/src/test/auxiliary/cci_impl_lib.rs +++ b/src/test/auxiliary/cci_impl_lib.rs @@ -20,7 +20,7 @@ impl uint_helpers for uint { let mut i = *self; while i < v { f(i); - i += 1u; + i += 1_usize; } } } diff --git a/src/test/auxiliary/cci_iter_lib.rs b/src/test/auxiliary/cci_iter_lib.rs index 3ba068df058..8e00b0dc7be 100644 --- a/src/test/auxiliary/cci_iter_lib.rs +++ b/src/test/auxiliary/cci_iter_lib.rs @@ -12,10 +12,10 @@ #[inline] pub fn iter(v: &[T], mut f: F) where F: FnMut(&T) { - let mut i = 0u; + let mut i = 0_usize; let n = v.len(); while i < n { f(&v[i]); - i += 1u; + i += 1_usize; } } diff --git a/src/test/auxiliary/cci_no_inline_lib.rs b/src/test/auxiliary/cci_no_inline_lib.rs index 474925d8838..ce041118906 100644 --- a/src/test/auxiliary/cci_no_inline_lib.rs +++ b/src/test/auxiliary/cci_no_inline_lib.rs @@ -13,10 +13,10 @@ // same as cci_iter_lib, more-or-less, but not marked inline pub fn iter(v: Vec , mut f: F) where F: FnMut(uint) { - let mut i = 0u; + let mut i = 0_usize; let n = v.len(); while i < n { f(v[i]); - i += 1u; + i += 1_usize; } } diff --git a/src/test/auxiliary/macro_reexport_1.rs b/src/test/auxiliary/macro_reexport_1.rs index a913749bc66..9c72cb1a680 100644 --- a/src/test/auxiliary/macro_reexport_1.rs +++ b/src/test/auxiliary/macro_reexport_1.rs @@ -11,5 +11,5 @@ #![crate_type = "dylib"] #[macro_export] macro_rules! reexported { - () => ( 3u ) + () => ( 3_usize ) } diff --git a/src/test/auxiliary/roman_numerals.rs b/src/test/auxiliary/roman_numerals.rs index 3fe7a29256d..e05aa16ba5f 100644 --- a/src/test/auxiliary/roman_numerals.rs +++ b/src/test/auxiliary/roman_numerals.rs @@ -47,7 +47,7 @@ fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree]) }; let mut text = &*text; - let mut total = 0u; + let mut total = 0_usize; while !text.is_empty() { match NUMERALS.iter().find(|&&(rn, _)| text.starts_with(rn)) { Some(&(rn, val)) => { diff --git a/src/test/auxiliary/unboxed-closures-cross-crate.rs b/src/test/auxiliary/unboxed-closures-cross-crate.rs index f03bcb41faf..a5178c03443 100644 --- a/src/test/auxiliary/unboxed-closures-cross-crate.rs +++ b/src/test/auxiliary/unboxed-closures-cross-crate.rs @@ -14,9 +14,9 @@ use std::ops::Add; #[inline] pub fn has_closures() -> uint { - let x = 1u; + let x = 1_usize; let mut f = move || x; - let y = 1u; + let y = 1_usize; let g = || y; f() + g() } diff --git a/src/test/bench/noise.rs b/src/test/bench/noise.rs index dc5b2f4596e..3b22e9ef69d 100644 --- a/src/test/bench/noise.rs +++ b/src/test/bench/noise.rs @@ -104,9 +104,9 @@ fn main() { let mut pixels = [0f32; 256*256]; let n2d = Noise2DContext::new(); - for _ in 0u..100 { - for y in 0u..256 { - for x in 0u..256 { + for _ in 0..100 { + for y in 0..256 { + for x in 0..256 { let v = n2d.get(x as f32 * 0.1, y as f32 * 0.1); pixels[y*256+x] = v * 0.5 + 0.5; } diff --git a/src/test/compile-fail-fulldeps/issue-18986.rs b/src/test/compile-fail-fulldeps/issue-18986.rs index 6845116e4a4..9b696e05c50 100644 --- a/src/test/compile-fail-fulldeps/issue-18986.rs +++ b/src/test/compile-fail-fulldeps/issue-18986.rs @@ -15,6 +15,6 @@ pub use use_from_trait_xc::Trait; fn main() { match () { - Trait { x: 42us } => () //~ ERROR use of trait `Trait` in a struct pattern + Trait { x: 42_usize } => () //~ ERROR use of trait `Trait` in a struct pattern } } diff --git a/src/test/compile-fail/asm-misplaced-option.rs b/src/test/compile-fail/asm-misplaced-option.rs index a29ead02b61..02d06c4e1bf 100644 --- a/src/test/compile-fail/asm-misplaced-option.rs +++ b/src/test/compile-fail/asm-misplaced-option.rs @@ -28,7 +28,7 @@ pub fn main() { unsafe { // comma in place of a colon - asm!("add $2, $1; mov $1, $0" : "=r"(x) : "r"(x), "r"(8us) : "cc", "volatile"); + asm!("add $2, $1; mov $1, $0" : "=r"(x) : "r"(x), "r"(8_usize) : "cc", "volatile"); //~^ WARNING expected a clobber, found an option } assert_eq!(x, 13); diff --git a/src/test/compile-fail/assign-to-method.rs b/src/test/compile-fail/assign-to-method.rs index b8aba7c483d..d32ea327d0a 100644 --- a/src/test/compile-fail/assign-to-method.rs +++ b/src/test/compile-fail/assign-to-method.rs @@ -15,7 +15,7 @@ struct cat { } impl cat { - pub fn speak(&self) { self.meows += 1us; } + pub fn speak(&self) { self.meows += 1_usize; } } fn cat(in_x : usize, in_y : isize) -> cat { @@ -26,6 +26,6 @@ fn cat(in_x : usize, in_y : isize) -> cat { } fn main() { - let nyan : cat = cat(52us, 99); + let nyan : cat = cat(52_usize, 99); nyan.speak = || println!("meow"); //~ ERROR attempted to take value of method } diff --git a/src/test/compile-fail/attr-before-let.rs b/src/test/compile-fail/attr-before-let.rs index acc9aa8a9a1..b4a90e35c40 100644 --- a/src/test/compile-fail/attr-before-let.rs +++ b/src/test/compile-fail/attr-before-let.rs @@ -10,5 +10,5 @@ fn main() { #[attr] //~ ERROR expected item - let _i = 0; + let __isize = 0; } diff --git a/src/test/compile-fail/bad-bang-ann-3.rs b/src/test/compile-fail/bad-bang-ann-3.rs index a35e0a13b02..58a8314af21 100644 --- a/src/test/compile-fail/bad-bang-ann-3.rs +++ b/src/test/compile-fail/bad-bang-ann-3.rs @@ -11,7 +11,7 @@ // Tests that a function with a ! annotation always actually fails fn bad_bang(i: usize) -> ! { - return 7us; //~ ERROR `return` in a function declared as diverging [E0166] + return 7_usize; //~ ERROR `return` in a function declared as diverging [E0166] } fn main() { bad_bang(5); } diff --git a/src/test/compile-fail/bad-bang-ann.rs b/src/test/compile-fail/bad-bang-ann.rs index aa073d82d30..03c24c2fa3d 100644 --- a/src/test/compile-fail/bad-bang-ann.rs +++ b/src/test/compile-fail/bad-bang-ann.rs @@ -11,7 +11,7 @@ // Tests that a function with a ! annotation always actually fails fn bad_bang(i: usize) -> ! { //~ ERROR computation may converge in a function marked as diverging - if i < 0us { } else { panic!(); } + if i < 0_usize { } else { panic!(); } } fn main() { bad_bang(5); } diff --git a/src/test/compile-fail/bad-method-typaram-kind.rs b/src/test/compile-fail/bad-method-typaram-kind.rs index 8e5a6054b89..a97cf5d41e8 100644 --- a/src/test/compile-fail/bad-method-typaram-kind.rs +++ b/src/test/compile-fail/bad-method-typaram-kind.rs @@ -9,7 +9,7 @@ // except according to those terms. fn foo() { - 1us.bar::(); //~ ERROR `core::marker::Send` is not implemented + 1_usize.bar::(); //~ ERROR `core::marker::Send` is not implemented } trait bar { diff --git a/src/test/compile-fail/borrow-immutable-upvar-mutation.rs b/src/test/compile-fail/borrow-immutable-upvar-mutation.rs index 7033f5caef6..a82aa12dc80 100644 --- a/src/test/compile-fail/borrow-immutable-upvar-mutation.rs +++ b/src/test/compile-fail/borrow-immutable-upvar-mutation.rs @@ -21,25 +21,25 @@ fn to_fn_mut>(f: F) -> F { f } fn main() { // By-ref captures { - let mut x = 0us; + let mut x = 0_usize; let _f = to_fn(|| x = 42); //~ ERROR cannot assign - let mut y = 0us; + let mut y = 0_usize; let _g = to_fn(|| set(&mut y)); //~ ERROR cannot borrow - let mut z = 0us; + let mut z = 0_usize; let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); }); //~ ERROR cannot assign } // By-value captures { - let mut x = 0us; + let mut x = 0_usize; let _f = to_fn(move || x = 42); //~ ERROR cannot assign - let mut y = 0us; + let mut y = 0_usize; let _g = to_fn(move || set(&mut y)); //~ ERROR cannot borrow - let mut z = 0us; + let mut z = 0_usize; let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); }); //~ ERROR cannot assign } } diff --git a/src/test/compile-fail/borrowck-borrow-overloaded-auto-deref-mut.rs b/src/test/compile-fail/borrowck-borrow-overloaded-auto-deref-mut.rs index 5db9ad2e3a4..dd278faa0dc 100644 --- a/src/test/compile-fail/borrowck-borrow-overloaded-auto-deref-mut.rs +++ b/src/test/compile-fail/borrowck-borrow-overloaded-auto-deref-mut.rs @@ -56,15 +56,15 @@ impl Point { } fn deref_imm_field(x: Own) { - let _i = &x.y; + let __isize = &x.y; } fn deref_mut_field1(x: Own) { - let _i = &mut x.y; //~ ERROR cannot borrow + let __isize = &mut x.y; //~ ERROR cannot borrow } fn deref_mut_field2(mut x: Own) { - let _i = &mut x.y; + let __isize = &mut x.y; } fn deref_extend_field(x: &Own) -> &isize { @@ -114,7 +114,7 @@ fn assign_field4<'a>(x: &'a mut Own) { // FIXME(eddyb) #12825 This shouldn't attempt to call deref_mut. /* fn deref_imm_method(x: Own) { - let _i = x.get(); + let __isize = x.get(); } */ diff --git a/src/test/compile-fail/borrowck-borrow-overloaded-auto-deref.rs b/src/test/compile-fail/borrowck-borrow-overloaded-auto-deref.rs index 75680de9c9e..693ed29bd05 100644 --- a/src/test/compile-fail/borrowck-borrow-overloaded-auto-deref.rs +++ b/src/test/compile-fail/borrowck-borrow-overloaded-auto-deref.rs @@ -50,15 +50,15 @@ impl Point { } fn deref_imm_field(x: Rc) { - let _i = &x.y; + let __isize = &x.y; } fn deref_mut_field1(x: Rc) { - let _i = &mut x.y; //~ ERROR cannot borrow + let __isize = &mut x.y; //~ ERROR cannot borrow } fn deref_mut_field2(mut x: Rc) { - let _i = &mut x.y; //~ ERROR cannot borrow + let __isize = &mut x.y; //~ ERROR cannot borrow } fn deref_extend_field(x: &Rc) -> &isize { @@ -86,7 +86,7 @@ fn assign_field3<'a>(x: &'a mut Rc) { } fn deref_imm_method(x: Rc) { - let _i = x.get(); + let __isize = x.get(); } fn deref_mut_method1(x: Rc) { diff --git a/src/test/compile-fail/borrowck-borrow-overloaded-deref-mut.rs b/src/test/compile-fail/borrowck-borrow-overloaded-deref-mut.rs index bfe53b739f4..34b926aab1f 100644 --- a/src/test/compile-fail/borrowck-borrow-overloaded-deref-mut.rs +++ b/src/test/compile-fail/borrowck-borrow-overloaded-deref-mut.rs @@ -32,15 +32,15 @@ impl DerefMut for Own { } fn deref_imm(x: Own) { - let _i = &*x; + let __isize = &*x; } fn deref_mut1(x: Own) { - let _i = &mut *x; //~ ERROR cannot borrow + let __isize = &mut *x; //~ ERROR cannot borrow } fn deref_mut2(mut x: Own) { - let _i = &mut *x; + let __isize = &mut *x; } fn deref_extend<'a>(x: &'a Own) -> &'a isize { diff --git a/src/test/compile-fail/borrowck-borrow-overloaded-deref.rs b/src/test/compile-fail/borrowck-borrow-overloaded-deref.rs index 153368f4894..5b916243b9e 100644 --- a/src/test/compile-fail/borrowck-borrow-overloaded-deref.rs +++ b/src/test/compile-fail/borrowck-borrow-overloaded-deref.rs @@ -26,15 +26,15 @@ impl Deref for Rc { } fn deref_imm(x: Rc) { - let _i = &*x; + let __isize = &*x; } fn deref_mut1(x: Rc) { - let _i = &mut *x; //~ ERROR cannot borrow + let __isize = &mut *x; //~ ERROR cannot borrow } fn deref_mut2(mut x: Rc) { - let _i = &mut *x; //~ ERROR cannot borrow + let __isize = &mut *x; //~ ERROR cannot borrow } fn deref_extend<'a>(x: &'a Rc) -> &'a isize { diff --git a/src/test/compile-fail/borrowck-lend-flow-match.rs b/src/test/compile-fail/borrowck-lend-flow-match.rs index 30ec993ed5e..f24e82d11c5 100644 --- a/src/test/compile-fail/borrowck-lend-flow-match.rs +++ b/src/test/compile-fail/borrowck-lend-flow-match.rs @@ -21,7 +21,7 @@ fn separate_arms() { // fact no outstanding loan of x! x = Some(0); } - Some(ref _i) => { + Some(ref __isize) => { x = Some(1); //~ ERROR cannot assign } } diff --git a/src/test/compile-fail/borrowck-report-with-custom-diagnostic.rs b/src/test/compile-fail/borrowck-report-with-custom-diagnostic.rs index 7093da6803c..21637370724 100644 --- a/src/test/compile-fail/borrowck-report-with-custom-diagnostic.rs +++ b/src/test/compile-fail/borrowck-report-with-custom-diagnostic.rs @@ -11,7 +11,7 @@ #![allow(dead_code)] fn main() { // Original borrow ends at end of function - let mut x = 1us; + let mut x = 1_usize; let y = &mut x; let z = &x; //~ ERROR cannot borrow } @@ -21,7 +21,7 @@ fn foo() { match true { true => { // Original borrow ends at end of match arm - let mut x = 1us; + let mut x = 1_usize; let y = &x; let z = &mut x; //~ ERROR cannot borrow } @@ -33,7 +33,7 @@ fn foo() { fn bar() { // Original borrow ends at end of closure || { - let mut x = 1us; + let mut x = 1_usize; let y = &mut x; let z = &mut x; //~ ERROR cannot borrow }; diff --git a/src/test/compile-fail/class-method-missing.rs b/src/test/compile-fail/class-method-missing.rs index 3b921e07279..ada45e8c1fc 100644 --- a/src/test/compile-fail/class-method-missing.rs +++ b/src/test/compile-fail/class-method-missing.rs @@ -27,5 +27,5 @@ fn cat(in_x : usize) -> cat { } fn main() { - let nyan = cat(0us); + let nyan = cat(0_usize); } diff --git a/src/test/compile-fail/class-missing-self.rs b/src/test/compile-fail/class-missing-self.rs index 4d8e4bca784..f25b2e65388 100644 --- a/src/test/compile-fail/class-missing-self.rs +++ b/src/test/compile-fail/class-missing-self.rs @@ -16,7 +16,7 @@ impl cat { fn sleep(&self) { loop{} } fn meow(&self) { println!("Meow"); - meows += 1us; //~ ERROR unresolved name + meows += 1_usize; //~ ERROR unresolved name sleep(); //~ ERROR unresolved name } 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 f66c68541b1..fa63b16afa6 100644 --- a/src/test/compile-fail/const-block-non-item-statement.rs +++ b/src/test/compile-fail/const-block-non-item-statement.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -const A: usize = { 1us; 2 }; +const A: usize = { 1_usize; 2 }; //~^ ERROR: blocks in constants are limited to items and tail expressions const B: usize = { { } 2 }; @@ -19,7 +19,7 @@ macro_rules! foo { } const C: usize = { foo!(); 2 }; -const D: usize = { let x = 4us; 2 }; +const D: usize = { let x = 4_usize; 2 }; //~^ ERROR: blocks in constants are limited to items and tail expressions pub fn main() { diff --git a/src/test/compile-fail/deriving-non-type.rs b/src/test/compile-fail/deriving-non-type.rs index 6015652668e..966e28a789c 100644 --- a/src/test/compile-fail/deriving-non-type.rs +++ b/src/test/compile-fail/deriving-non-type.rs @@ -22,10 +22,10 @@ impl S { } impl T for S { } #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums -static s: usize = 0us; +static s: usize = 0_usize; #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums -const c: usize = 0us; +const c: usize = 0_usize; #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums mod m { } diff --git a/src/test/compile-fail/feature-gate-int-uint.rs b/src/test/compile-fail/feature-gate-int-uint.rs index 016a0394289..344afa34799 100644 --- a/src/test/compile-fail/feature-gate-int-uint.rs +++ b/src/test/compile-fail/feature-gate-int-uint.rs @@ -16,7 +16,7 @@ mod u { x: uint //~ WARN the `uint` type is deprecated } fn bar(x: uint) { //~ WARN the `uint` type is deprecated - 1u; //~ WARN the `u` suffix on integers is deprecated + 1_usize; } } mod i { @@ -25,7 +25,7 @@ mod i { x: int //~ WARN the `int` type is deprecated } fn bar(x: int) { //~ WARN the `int` type is deprecated - 1i; //~ WARN the `i` suffix on integers is deprecated + 1_isize; } } diff --git a/src/test/compile-fail/import-glob-circular.rs b/src/test/compile-fail/import-glob-circular.rs index 0f6e3dc134d..f38172db444 100644 --- a/src/test/compile-fail/import-glob-circular.rs +++ b/src/test/compile-fail/import-glob-circular.rs @@ -13,13 +13,13 @@ mod circ1 { pub use circ2::f2; pub fn f1() { println!("f1"); } - pub fn common() -> usize { return 0us; } + pub fn common() -> usize { return 0_usize; } } mod circ2 { pub use circ1::f1; pub fn f2() { println!("f2"); } - pub fn common() -> usize { return 1us; } + pub fn common() -> usize { return 1_usize; } } mod test { diff --git a/src/test/compile-fail/index-bot.rs b/src/test/compile-fail/index-bot.rs index 876c1e481f6..b28f2a746fd 100644 --- a/src/test/compile-fail/index-bot.rs +++ b/src/test/compile-fail/index-bot.rs @@ -9,5 +9,5 @@ // except according to those terms. fn main() { - (return)[0us]; //~ ERROR the type of this value must be known in this context + (return)[0_usize]; //~ ERROR the type of this value must be known in this context } diff --git a/src/test/compile-fail/infinite-instantiation.rs b/src/test/compile-fail/infinite-instantiation.rs index a922f5fe452..2642ac6204c 100644 --- a/src/test/compile-fail/infinite-instantiation.rs +++ b/src/test/compile-fail/infinite-instantiation.rs @@ -28,11 +28,11 @@ impl to_opt for Option { } fn function(counter: usize, t: T) { - if counter > 0us { - function(counter - 1us, t.to_option()); + if counter > 0_usize { + function(counter - 1_usize, t.to_option()); } } fn main() { - function(22us, 22us); + function(22_usize, 22_usize); } diff --git a/src/test/compile-fail/integral-indexing.rs b/src/test/compile-fail/integral-indexing.rs index 88dd63384b7..e8998dd7a9d 100644 --- a/src/test/compile-fail/integral-indexing.rs +++ b/src/test/compile-fail/integral-indexing.rs @@ -11,7 +11,7 @@ pub fn main() { let v: Vec = vec!(0, 1, 2, 3, 4, 5); let s: String = "abcdef".to_string(); - v[3us]; + v[3_usize]; v[3]; v[3u8]; //~ERROR the trait `core::ops::Index` is not implemented //~^ ERROR the trait `core::ops::Index` is not implemented @@ -21,7 +21,7 @@ pub fn main() { //~^ ERROR the trait `core::ops::Index` is not implemented v[3i32]; //~ERROR the trait `core::ops::Index` is not implemented //~^ ERROR the trait `core::ops::Index` is not implemented - s.as_bytes()[3us]; + s.as_bytes()[3_usize]; s.as_bytes()[3]; s.as_bytes()[3u8]; //~ERROR the trait `core::ops::Index` is not implemented //~^ERROR the trait `core::ops::Index` is not implemented diff --git a/src/test/compile-fail/issue-13466.rs b/src/test/compile-fail/issue-13466.rs index 09e2905dc40..16128e52d64 100644 --- a/src/test/compile-fail/issue-13466.rs +++ b/src/test/compile-fail/issue-13466.rs @@ -14,7 +14,7 @@ pub fn main() { // The expected arm type `Option` has one type parameter, while // the actual arm `Result` has two. typeck should not be // tricked into looking up a non-existing second type parameter. - let _x: usize = match Some(1us) { + let _x: usize = match Some(1_usize) { Ok(u) => u, //~^ ERROR mismatched types //~| expected `core::option::Option` diff --git a/src/test/compile-fail/issue-17283.rs b/src/test/compile-fail/issue-17283.rs index 4889658d083..65731379094 100644 --- a/src/test/compile-fail/issue-17283.rs +++ b/src/test/compile-fail/issue-17283.rs @@ -16,7 +16,7 @@ struct Foo { } fn main() { - let x = 1us; + let x = 1_usize; let y: Foo; // `x { ... }` should not be interpreted as a struct literal here diff --git a/src/test/compile-fail/issue-17441.rs b/src/test/compile-fail/issue-17441.rs index e9e69dadd3b..321b8b260da 100644 --- a/src/test/compile-fail/issue-17441.rs +++ b/src/test/compile-fail/issue-17441.rs @@ -11,16 +11,16 @@ #![feature(box_syntax)] fn main() { - let _foo = &[1us, 2] as [usize]; + let _foo = &[1_usize, 2] as [usize]; //~^ ERROR cast to unsized type: `&[usize; 2]` as `[usize]` //~^^ HELP consider using an implicit coercion to `&[usize]` instead - let _bar = box 1us as std::fmt::Show; + let _bar = box 1_usize as std::fmt::Show; //~^ ERROR cast to unsized type: `Box` as `core::fmt::Show` //~^^ HELP did you mean `Box`? - let _baz = 1us as std::fmt::Show; + let _baz = 1_usize as std::fmt::Show; //~^ ERROR cast to unsized type: `usize` as `core::fmt::Show` //~^^ HELP consider using a box or reference as appropriate - let _quux = [1us, 2] as [usize]; + let _quux = [1_usize, 2] as [usize]; //~^ ERROR cast to unsized type: `[usize; 2]` as `[usize]` //~^^ HELP consider using a box or reference as appropriate } diff --git a/src/test/compile-fail/issue-17651.rs b/src/test/compile-fail/issue-17651.rs index 1cdf48e291c..172f37af834 100644 --- a/src/test/compile-fail/issue-17651.rs +++ b/src/test/compile-fail/issue-17651.rs @@ -14,7 +14,7 @@ #![feature(box_syntax)] fn main() { - (|| box *[0us].as_slice())(); + (|| box *[0_usize].as_slice())(); //~^ ERROR cannot move out of borrowed content //~^^ ERROR cannot move a value of type [usize] } diff --git a/src/test/compile-fail/issue-17718-patterns.rs b/src/test/compile-fail/issue-17718-patterns.rs index 6c4d0874703..b7f58791bfc 100644 --- a/src/test/compile-fail/issue-17718-patterns.rs +++ b/src/test/compile-fail/issue-17718-patterns.rs @@ -13,7 +13,7 @@ static mut A2: usize = 1; const A3: usize = 1; fn main() { - match 1us { + match 1_usize { A1 => {} //~ ERROR: static variables cannot be referenced in a pattern A2 => {} //~ ERROR: static variables cannot be referenced in a pattern A3 => {} diff --git a/src/test/compile-fail/issue-17913.rs b/src/test/compile-fail/issue-17913.rs index 1f5264aef61..8035cffabda 100644 --- a/src/test/compile-fail/issue-17913.rs +++ b/src/test/compile-fail/issue-17913.rs @@ -15,14 +15,14 @@ #[cfg(target_pointer_width = "64")] fn main() { - let n = 0us; - let a = box [&n; 0xF000000000000000us]; - println!("{}", a[0xFFFFFFu]); + let n = 0_usize; + let a = box [&n; 0xF000000000000000_usize]; + println!("{}", a[0xFFFFFF_usize]); } #[cfg(target_pointer_width = "32")] fn main() { - let n = 0us; - let a = box [&n; 0xFFFFFFFFu]; - println!("{}", a[0xFFFFFFu]); + let n = 0_usize; + let a = box [&n; 0xFFFFFFFF_usize]; + println!("{}", a[0xFFFFFF_usize]); } diff --git a/src/test/compile-fail/issue-17933.rs b/src/test/compile-fail/issue-17933.rs index 47f8d75250d..bd047408498 100644 --- a/src/test/compile-fail/issue-17933.rs +++ b/src/test/compile-fail/issue-17933.rs @@ -8,10 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub static X: usize = 1us; +pub static X: usize = 1_usize; fn main() { - match 1us { + match 1_usize { self::X => { }, //~^ ERROR static variables cannot be referenced in a pattern, use a `const` instead _ => { }, diff --git a/src/test/compile-fail/issue-1802-2.rs b/src/test/compile-fail/issue-1802-2.rs index c7aacdfc68a..f6da2fc82c3 100644 --- a/src/test/compile-fail/issue-1802-2.rs +++ b/src/test/compile-fail/issue-1802-2.rs @@ -10,5 +10,5 @@ // error-pattern:no valid digits found for number fn main() { - log(error, 0bu); + log(error, 0b_usize); } diff --git a/src/test/compile-fail/issue-18107.rs b/src/test/compile-fail/issue-18107.rs index 83427e8aa67..91689988f58 100644 --- a/src/test/compile-fail/issue-18107.rs +++ b/src/test/compile-fail/issue-18107.rs @@ -16,7 +16,7 @@ fn _create_render(_: &()) -> AbstractRenderer //~^ ERROR: the trait `core::marker::Sized` is not implemented { - match 0us { + match 0_usize { _ => unimplemented!() } } diff --git a/src/test/compile-fail/issue-18252.rs b/src/test/compile-fail/issue-18252.rs index 822c86d1d3e..54c51405bd7 100644 --- a/src/test/compile-fail/issue-18252.rs +++ b/src/test/compile-fail/issue-18252.rs @@ -13,5 +13,5 @@ enum Foo { } fn main() { - let f = Foo::Variant(42us); //~ ERROR uses it like a function + let f = Foo::Variant(42_usize); //~ ERROR uses it like a function } diff --git a/src/test/compile-fail/issue-18566.rs b/src/test/compile-fail/issue-18566.rs index 85dda340d19..dd3844b1a0e 100644 --- a/src/test/compile-fail/issue-18566.rs +++ b/src/test/compile-fail/issue-18566.rs @@ -28,7 +28,7 @@ impl Tr for usize { } fn main() { - let s = &mut 1us; + let s = &mut 1_usize; MyPtr(s).poke(s); //~^ ERROR cannot borrow `*s` as mutable more than once at a time diff --git a/src/test/compile-fail/issue-18783.rs b/src/test/compile-fail/issue-18783.rs index d26bf68cb5d..5ddf06add9d 100644 --- a/src/test/compile-fail/issue-18783.rs +++ b/src/test/compile-fail/issue-18783.rs @@ -13,7 +13,7 @@ use std::cell::RefCell; fn main() { - let mut y = 1us; + let mut y = 1_usize; let c = RefCell::new(vec![]); c.push(box || y = 0); c.push(box || y = 0); @@ -21,7 +21,7 @@ fn main() { } fn ufcs() { - let mut y = 1us; + let mut y = 1_usize; let c = RefCell::new(vec![]); Push::push(&c, box || y = 0); diff --git a/src/test/compile-fail/issue-18959.rs b/src/test/compile-fail/issue-18959.rs index e174fb9b7ad..368f3c16f51 100644 --- a/src/test/compile-fail/issue-18959.rs +++ b/src/test/compile-fail/issue-18959.rs @@ -17,7 +17,7 @@ impl Foo for Thing { fn foo(&self, _: &T) {} } -#[inline(never)] fn foo(b: &Bar) { b.foo(&0us) } +#[inline(never)] fn foo(b: &Bar) { b.foo(&0_usize) } fn main() { let mut thing = Thing; diff --git a/src/test/compile-fail/issue-2150.rs b/src/test/compile-fail/issue-2150.rs index 79df16c8979..505885e6c41 100644 --- a/src/test/compile-fail/issue-2150.rs +++ b/src/test/compile-fail/issue-2150.rs @@ -15,7 +15,7 @@ fn fail_len(v: Vec ) -> usize { let mut i = 3; panic!(); - for x in &v { i += 1us; } + for x in &v { i += 1_usize; } //~^ ERROR: unreachable statement return i; } diff --git a/src/test/compile-fail/issue-4517.rs b/src/test/compile-fail/issue-4517.rs index 881e124fd68..6d4777be40b 100644 --- a/src/test/compile-fail/issue-4517.rs +++ b/src/test/compile-fail/issue-4517.rs @@ -11,7 +11,7 @@ fn bar(int_param: usize) {} fn main() { - let foo: [u8; 4] = [1u8; 4us]; + let foo: [u8; 4] = [1u8; 4_usize]; bar(foo); //~^ ERROR mismatched types //~| expected `usize` diff --git a/src/test/compile-fail/issue-5544-a.rs b/src/test/compile-fail/issue-5544-a.rs index 42a18ba5fb7..95a4f36d171 100644 --- a/src/test/compile-fail/issue-5544-a.rs +++ b/src/test/compile-fail/issue-5544-a.rs @@ -9,6 +9,6 @@ // except according to those terms. fn main() { - let _i = 18446744073709551616; // 2^64 + let __isize = 18446744073709551616; // 2^64 //~^ ERROR int literal is too large } diff --git a/src/test/compile-fail/issue-5544-b.rs b/src/test/compile-fail/issue-5544-b.rs index 1f166ec0d1c..afff5984b46 100644 --- a/src/test/compile-fail/issue-5544-b.rs +++ b/src/test/compile-fail/issue-5544-b.rs @@ -9,6 +9,6 @@ // except according to those terms. fn main() { - let _i = 0xff_ffff_ffff_ffff_ffff_is; + let __isize = 0xff_ffff_ffff_ffff_ffff__isize; //~^ ERROR int literal is too large } diff --git a/src/test/compile-fail/issue-7575.rs b/src/test/compile-fail/issue-7575.rs index 49e54f25bf6..9e6000c050a 100644 --- a/src/test/compile-fail/issue-7575.rs +++ b/src/test/compile-fail/issue-7575.rs @@ -30,17 +30,17 @@ trait UnusedTrait { impl CtxtFn for usize { fn f8(self, i: usize) -> usize { - i * 4us + i * 4_usize } fn f9(i: usize) -> usize { - i * 4us + i * 4_usize } } impl OtherTrait for usize { fn f9(i: usize) -> usize { - i * 8us + i * 8_usize } } diff --git a/src/test/compile-fail/issue-8460-const.rs b/src/test/compile-fail/issue-8460-const.rs index b6d371e4b11..954ae8ebc48 100644 --- a/src/test/compile-fail/issue-8460-const.rs +++ b/src/test/compile-fail/issue-8460-const.rs @@ -22,7 +22,7 @@ fn main() { //~^ ERROR attempted to divide with overflow in a constant expression assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err()); //~^ ERROR attempted to divide with overflow in a constant expression - assert!(thread::spawn(move|| { 1is / 0; }).join().is_err()); + assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err()); //~^ ERROR attempted to divide by zero in a constant expression assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err()); //~^ ERROR attempted to divide by zero in a constant expression @@ -42,7 +42,7 @@ fn main() { //~^ ERROR attempted remainder with overflow in a constant expression assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err()); //~^ ERROR attempted remainder with overflow in a constant expression - assert!(thread::spawn(move|| { 1is % 0; }).join().is_err()); + assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err()); //~^ ERROR attempted remainder with a divisor of zero in a constant expression assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err()); //~^ ERROR attempted remainder with a divisor of zero in a constant expression diff --git a/src/test/compile-fail/issue-8537.rs b/src/test/compile-fail/issue-8537.rs index dba9e751f71..52cf420a9ff 100644 --- a/src/test/compile-fail/issue-8537.rs +++ b/src/test/compile-fail/issue-8537.rs @@ -9,7 +9,7 @@ // except according to those terms. pub extern - "invalid-abi" //~ ERROR illegal ABI + "invalid-ab_isize" //~ ERROR illegal ABI fn foo() {} fn main() {} diff --git a/src/test/compile-fail/kindck-nonsendable-1.rs b/src/test/compile-fail/kindck-nonsendable-1.rs index 5bc769f8e11..e6041cddead 100644 --- a/src/test/compile-fail/kindck-nonsendable-1.rs +++ b/src/test/compile-fail/kindck-nonsendable-1.rs @@ -16,7 +16,7 @@ fn foo(_x: Rc) {} fn bar(_: F) { } fn main() { - let x = Rc::new(3us); + let x = Rc::new(3_usize); bar(move|| foo(x)); //~^ ERROR `core::marker::Send` is not implemented } diff --git a/src/test/compile-fail/lint-dead-code-4.rs b/src/test/compile-fail/lint-dead-code-4.rs index 449788459dc..f304c26efb5 100644 --- a/src/test/compile-fail/lint-dead-code-4.rs +++ b/src/test/compile-fail/lint-dead-code-4.rs @@ -63,6 +63,6 @@ fn field_match_in_let(f: Bar) -> bool { fn main() { field_read(Foo { x: 1, b: false, marker: std::marker::NoCopy }); field_match_in_patterns(XYZ::Z); - field_match_in_let(Bar { x: 42us, b: true, _guard: () }); + field_match_in_let(Bar { x: 42_usize, b: true, _guard: () }); let _ = Baz { x: 0 }; } diff --git a/src/test/compile-fail/lint-exceeding-bitshifts.rs b/src/test/compile-fail/lint-exceeding-bitshifts.rs index 98853a2e9a1..345e56e2e58 100644 --- a/src/test/compile-fail/lint-exceeding-bitshifts.rs +++ b/src/test/compile-fail/lint-exceeding-bitshifts.rs @@ -57,7 +57,7 @@ fn main() { let n = 1u8 << (4+3); let n = 1u8 << (4+4); //~ ERROR: bitshift exceeds the type's number of bits - let n = 1is << std::isize::BITS; //~ ERROR: bitshift exceeds the type's number of bits - let n = 1us << std::usize::BITS; //~ ERROR: bitshift exceeds the type's number of bits + let n = 1_isize << std::isize::BITS; //~ ERROR: bitshift exceeds the type's number of bits + let n = 1_usize << std::usize::BITS; //~ ERROR: bitshift exceeds the type's number of bits } diff --git a/src/test/compile-fail/lint-obsolete-attr.rs b/src/test/compile-fail/lint-obsolete-attr.rs index dd4e1212a00..b234f08d04a 100644 --- a/src/test/compile-fail/lint-obsolete-attr.rs +++ b/src/test/compile-fail/lint-obsolete-attr.rs @@ -15,7 +15,7 @@ #![allow(dead_code)] #![feature(custom_attribute)] -#[abi="stdcall"] extern {} //~ ERROR unused attribute +#[ab_isize="stdcall"] extern {} //~ ERROR unused attribute #[fixed_stack_segment] fn f() {} //~ ERROR unused attribute diff --git a/src/test/compile-fail/lint-type-limits.rs b/src/test/compile-fail/lint-type-limits.rs index 95d892010e7..c00bd2adaa2 100644 --- a/src/test/compile-fail/lint-type-limits.rs +++ b/src/test/compile-fail/lint-type-limits.rs @@ -14,7 +14,7 @@ fn main() { } fn foo() { - let mut i = 100us; + let mut i = 100_usize; while i >= 0 { //~ ERROR comparison is useless due to type limits i -= 1; } @@ -50,12 +50,12 @@ fn qux() { } fn quy() { - let i = -23us; //~ WARNING negation of unsigned int literal may be unintentional + let i = -23_usize; //~ WARNING negation of unsigned int literal may be unintentional //~^ WARNING unused variable } fn quz() { - let i = 23us; + let i = 23_usize; let j = -i; //~ WARNING negation of unsigned int variable may be unintentional //~^ WARNING unused variable } diff --git a/src/test/compile-fail/macro-no-implicit-reexport.rs b/src/test/compile-fail/macro-no-implicit-reexport.rs index 1e2172f4a7c..13dbab12b77 100644 --- a/src/test/compile-fail/macro-no-implicit-reexport.rs +++ b/src/test/compile-fail/macro-no-implicit-reexport.rs @@ -16,5 +16,5 @@ extern crate macro_non_reexport_2; fn main() { - assert_eq!(reexported!(), 3us); //~ ERROR macro undefined + assert_eq!(reexported!(), 3_usize); //~ ERROR macro undefined } diff --git a/src/test/compile-fail/macro-reexport-not-locally-visible.rs b/src/test/compile-fail/macro-reexport-not-locally-visible.rs index 6859ccfe3b7..dc8f4fadc76 100644 --- a/src/test/compile-fail/macro-reexport-not-locally-visible.rs +++ b/src/test/compile-fail/macro-reexport-not-locally-visible.rs @@ -18,5 +18,5 @@ extern crate macro_reexport_1; fn main() { - assert_eq!(reexported!(), 3us); //~ ERROR macro undefined + assert_eq!(reexported!(), 3_usize); //~ ERROR macro undefined } diff --git a/src/test/compile-fail/match-ill-type1.rs b/src/test/compile-fail/match-ill-type1.rs index 908d46f398c..c60ef2ed287 100644 --- a/src/test/compile-fail/match-ill-type1.rs +++ b/src/test/compile-fail/match-ill-type1.rs @@ -10,7 +10,7 @@ fn main() { match 1 { - 1...2us => 1, //~ ERROR mismatched types in range + 1...2_usize => 1, //~ ERROR mismatched types in range _ => 2, }; } diff --git a/src/test/compile-fail/method-ambig-two-traits-cross-crate.rs b/src/test/compile-fail/method-ambig-two-traits-cross-crate.rs index cab6a8610bf..981c4c6f40d 100644 --- a/src/test/compile-fail/method-ambig-two-traits-cross-crate.rs +++ b/src/test/compile-fail/method-ambig-two-traits-cross-crate.rs @@ -18,5 +18,5 @@ trait me2 { fn me(&self) -> usize; } impl me2 for usize { fn me(&self) -> usize { *self } } -fn main() { 1us.me(); } //~ ERROR E0034 +fn main() { 1_usize.me(); } //~ ERROR E0034 diff --git a/src/test/compile-fail/method-ambig-two-traits-with-default-method.rs b/src/test/compile-fail/method-ambig-two-traits-with-default-method.rs index 87e3655d31e..17312fb1869 100644 --- a/src/test/compile-fail/method-ambig-two-traits-with-default-method.rs +++ b/src/test/compile-fail/method-ambig-two-traits-with-default-method.rs @@ -19,5 +19,5 @@ impl Foo for usize {} impl Bar for usize {} fn main() { - 1us.method(); //~ ERROR E0034 + 1_usize.method(); //~ ERROR E0034 } diff --git a/src/test/compile-fail/mutable-class-fields-2.rs b/src/test/compile-fail/mutable-class-fields-2.rs index 932c2a9715f..b6744d4b33a 100644 --- a/src/test/compile-fail/mutable-class-fields-2.rs +++ b/src/test/compile-fail/mutable-class-fields-2.rs @@ -29,6 +29,6 @@ fn cat(in_x : usize, in_y : isize) -> cat { } fn main() { - let nyan : cat = cat(52us, 99); + let nyan : cat = cat(52_usize, 99); nyan.eat(); } diff --git a/src/test/compile-fail/mutable-class-fields.rs b/src/test/compile-fail/mutable-class-fields.rs index a840ac63dd8..94b1047f85e 100644 --- a/src/test/compile-fail/mutable-class-fields.rs +++ b/src/test/compile-fail/mutable-class-fields.rs @@ -21,6 +21,6 @@ fn cat(in_x : usize, in_y : isize) -> cat { } fn main() { - let nyan : cat = cat(52us, 99); + let nyan : cat = cat(52_usize, 99); nyan.how_hungry = 0; //~ ERROR cannot assign } diff --git a/src/test/compile-fail/no-method-suggested-traits.rs b/src/test/compile-fail/no-method-suggested-traits.rs index 2c14dfad3b8..21f8a982806 100644 --- a/src/test/compile-fail/no-method-suggested-traits.rs +++ b/src/test/compile-fail/no-method-suggested-traits.rs @@ -123,8 +123,8 @@ fn main() { //~^^^ HELP `no_method_suggested_traits::foo::PubPub` // should have no help: - 1us.method3(); //~ ERROR does not implement - std::rc::Rc::new(&mut Box::new(&1us)).method3(); //~ ERROR does not implement + 1_usize.method3(); //~ ERROR does not implement + std::rc::Rc::new(&mut Box::new(&1_usize)).method3(); //~ ERROR does not implement no_method_suggested_traits::Foo.method3(); //~ ERROR does not implement std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method3(); //~^ ERROR does not implement diff --git a/src/test/compile-fail/non-exhaustive-pattern-witness.rs b/src/test/compile-fail/non-exhaustive-pattern-witness.rs index 3bd3a0c653c..0eb91e0419a 100644 --- a/src/test/compile-fail/non-exhaustive-pattern-witness.rs +++ b/src/test/compile-fail/non-exhaustive-pattern-witness.rs @@ -27,7 +27,7 @@ fn struct_with_a_nested_enum_and_vector() { Foo { first: true, second: None } => (), Foo { first: true, second: Some(_) } => (), Foo { first: false, second: None } => (), - Foo { first: false, second: Some([1us, 2us, 3us, 4us]) } => () + Foo { first: false, second: Some([1_usize, 2_usize, 3_usize, 4_usize]) } => () } } diff --git a/src/test/compile-fail/or-patter-mismatch.rs b/src/test/compile-fail/or-patter-mismatch.rs index 74f674e64ba..4b261d89888 100644 --- a/src/test/compile-fail/or-patter-mismatch.rs +++ b/src/test/compile-fail/or-patter-mismatch.rs @@ -12,4 +12,4 @@ enum blah { a(isize, isize, usize), b(isize, isize), } -fn main() { match blah::a(1, 1, 2us) { blah::a(_, x, y) | blah::b(x, y) => { } } } +fn main() { match blah::a(1, 1, 2_usize) { blah::a(_, x, y) | blah::b(x, y) => { } } } diff --git a/src/test/compile-fail/private-method.rs b/src/test/compile-fail/private-method.rs index e8e26cf8ce3..ccbdd52a983 100644 --- a/src/test/compile-fail/private-method.rs +++ b/src/test/compile-fail/private-method.rs @@ -30,6 +30,6 @@ mod kitties { } fn main() { - let nyan : kitties::cat = kitties::cat(52us, 99); + let nyan : kitties::cat = kitties::cat(52_usize, 99); nyan.nap(); } diff --git a/src/test/compile-fail/private-struct-field-cross-crate.rs b/src/test/compile-fail/private-struct-field-cross-crate.rs index 36b6000ceeb..243d835d46e 100644 --- a/src/test/compile-fail/private-struct-field-cross-crate.rs +++ b/src/test/compile-fail/private-struct-field-cross-crate.rs @@ -13,7 +13,7 @@ extern crate cci_class; use cci_class::kitties::cat; fn main() { - let nyan : cat = cat(52us, 99); - assert!((nyan.meows == 52us)); + let nyan : cat = cat(52_usize, 99); + assert!((nyan.meows == 52_usize)); //~^ ERROR field `meows` of struct `cci_class::kitties::cat` is private } diff --git a/src/test/compile-fail/regions-addr-of-self.rs b/src/test/compile-fail/regions-addr-of-self.rs index b69224d4499..45e468b3ab0 100644 --- a/src/test/compile-fail/regions-addr-of-self.rs +++ b/src/test/compile-fail/regions-addr-of-self.rs @@ -15,18 +15,18 @@ struct dog { impl dog { pub fn chase_cat(&mut self) { let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer - *p += 1us; + *p += 1_usize; } pub fn chase_cat_2(&mut self) { let p: &mut usize = &mut self.cats_chased; - *p += 1us; + *p += 1_usize; } } fn dog() -> dog { dog { - cats_chased: 0us + cats_chased: 0_usize } } diff --git a/src/test/compile-fail/regions-addr-of-upvar-self.rs b/src/test/compile-fail/regions-addr-of-upvar-self.rs index 70d5fe83055..8cc2dd6afc6 100644 --- a/src/test/compile-fail/regions-addr-of-upvar-self.rs +++ b/src/test/compile-fail/regions-addr-of-upvar-self.rs @@ -18,7 +18,7 @@ impl dog { pub fn chase_cat(&mut self) { let _f = || { let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer - *p = 3us; + *p = 3_usize; }; } } diff --git a/src/test/compile-fail/regions-creating-enums.rs b/src/test/compile-fail/regions-creating-enums.rs index 83cef9397c3..4c361427bf3 100644 --- a/src/test/compile-fail/regions-creating-enums.rs +++ b/src/test/compile-fail/regions-creating-enums.rs @@ -14,8 +14,8 @@ enum ast<'a> { } fn build() { - let x = ast::num(3us); - let y = ast::num(4us); + let x = ast::num(3_usize); + let y = ast::num(4_usize); let z = ast::add(&x, &y); compute(&z); } diff --git a/src/test/compile-fail/regions-infer-invariance-due-to-decl.rs b/src/test/compile-fail/regions-infer-invariance-due-to-decl.rs index 5f4a1af6bf9..e88c96de9e4 100644 --- a/src/test/compile-fail/regions-infer-invariance-due-to-decl.rs +++ b/src/test/compile-fail/regions-infer-invariance-due-to-decl.rs @@ -14,12 +14,12 @@ struct invariant<'a> { marker: marker::InvariantLifetime<'a> } -fn to_same_lifetime<'r>(bi: invariant<'r>) { - let bj: invariant<'r> = bi; +fn to_same_lifetime<'r>(b_isize: invariant<'r>) { + let bj: invariant<'r> = b_isize; } -fn to_longer_lifetime<'r>(bi: invariant<'r>) -> invariant<'static> { - bi //~ ERROR mismatched types +fn to_longer_lifetime<'r>(b_isize: invariant<'r>) -> invariant<'static> { + b_isize //~ ERROR mismatched types } fn main() { diff --git a/src/test/compile-fail/regions-infer-invariance-due-to-mutability-3.rs b/src/test/compile-fail/regions-infer-invariance-due-to-mutability-3.rs index e42aa684e14..f280e4d978e 100644 --- a/src/test/compile-fail/regions-infer-invariance-due-to-mutability-3.rs +++ b/src/test/compile-fail/regions-infer-invariance-due-to-mutability-3.rs @@ -13,12 +13,12 @@ struct invariant<'a> { f: Box, } -fn to_same_lifetime<'r>(bi: invariant<'r>) { - let bj: invariant<'r> = bi; +fn to_same_lifetime<'r>(b_isize: invariant<'r>) { + let bj: invariant<'r> = b_isize; } -fn to_longer_lifetime<'r>(bi: invariant<'r>) -> invariant<'static> { - bi //~ ERROR mismatched types +fn to_longer_lifetime<'r>(b_isize: invariant<'r>) -> invariant<'static> { + b_isize //~ ERROR mismatched types } fn main() { diff --git a/src/test/compile-fail/regions-infer-invariance-due-to-mutability-4.rs b/src/test/compile-fail/regions-infer-invariance-due-to-mutability-4.rs index 2a246124f6f..ced0afcebd9 100644 --- a/src/test/compile-fail/regions-infer-invariance-due-to-mutability-4.rs +++ b/src/test/compile-fail/regions-infer-invariance-due-to-mutability-4.rs @@ -13,12 +13,12 @@ struct Invariant<'a> { f: Box FnOnce() -> &'b mut &'a isize + 'static>, } -fn to_same_lifetime<'r>(bi: Invariant<'r>) { - let bj: Invariant<'r> = bi; +fn to_same_lifetime<'r>(b_isize: Invariant<'r>) { + let bj: Invariant<'r> = b_isize; } -fn to_longer_lifetime<'r>(bi: Invariant<'r>) -> Invariant<'static> { - bi //~ ERROR mismatched types +fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { + b_isize //~ ERROR mismatched types } fn main() { diff --git a/src/test/compile-fail/regions-return-ref-to-upvar-issue-17403.rs b/src/test/compile-fail/regions-return-ref-to-upvar-issue-17403.rs index 2e3531a2e8f..aa20efa5a12 100644 --- a/src/test/compile-fail/regions-return-ref-to-upvar-issue-17403.rs +++ b/src/test/compile-fail/regions-return-ref-to-upvar-issue-17403.rs @@ -15,7 +15,7 @@ fn main() { // Unboxed closure case { - let mut x = 0us; + let mut x = 0_usize; let mut f = || &mut x; //~ ERROR cannot infer let x = f(); let y = f(); diff --git a/src/test/compile-fail/regions-trait-1.rs b/src/test/compile-fail/regions-trait-1.rs index 63052580dc2..b45a37d26e5 100644 --- a/src/test/compile-fail/regions-trait-1.rs +++ b/src/test/compile-fail/regions-trait-1.rs @@ -34,7 +34,7 @@ fn get_v(gc: Box) -> usize { } fn main() { - let ctxt = ctxt { v: 22us }; + let ctxt = ctxt { v: 22_usize }; let hc = has_ctxt { c: &ctxt }; - assert_eq!(get_v(box hc as Box), 22us); + assert_eq!(get_v(box hc as Box), 22_usize); } diff --git a/src/test/compile-fail/repeat_count.rs b/src/test/compile-fail/repeat_count.rs index d730add00b7..9b3e2668042 100644 --- a/src/test/compile-fail/repeat_count.rs +++ b/src/test/compile-fail/repeat_count.rs @@ -41,14 +41,14 @@ fn main() { //~| expected usize //~| found &-ptr //~| ERROR expected positive integer for repeat count, found string - let f = [0; -4is]; + let f = [0; -4_isize]; //~^ ERROR mismatched types //~| expected `usize` //~| found `isize` //~| expected usize //~| found isize //~| ERROR expected positive integer for repeat count, found negative integer - let f = [0us; -1is]; + let f = [0_usize; -1_isize]; //~^ ERROR mismatched types //~| expected `usize` //~| found `isize` diff --git a/src/test/compile-fail/shadowed-lifetime.rs b/src/test/compile-fail/shadowed-lifetime.rs index bf8a8f5046e..725f83d4957 100644 --- a/src/test/compile-fail/shadowed-lifetime.rs +++ b/src/test/compile-fail/shadowed-lifetime.rs @@ -39,5 +39,5 @@ fn main() { // just to ensure that this test fails to compile; when shadowed // lifetimes become either an error or a proper lint, this will // not be needed. - let x: isize = 3us; //~ ERROR mismatched types + let x: isize = 3_usize; //~ ERROR mismatched types } diff --git a/src/test/compile-fail/struct-base-wrong-type.rs b/src/test/compile-fail/struct-base-wrong-type.rs index 71a2b50b612..a2ad2336d4b 100644 --- a/src/test/compile-fail/struct-base-wrong-type.rs +++ b/src/test/compile-fail/struct-base-wrong-type.rs @@ -30,7 +30,7 @@ fn main() { //~| found `Bar` //~| expected struct `Foo` //~| found struct `Bar` - let f_i = Foo { a: 2, ..4 }; //~ ERROR mismatched types + let f__isize = Foo { a: 2, ..4 }; //~ ERROR mismatched types //~| expected `Foo` //~| found `_` //~| expected struct `Foo` diff --git a/src/test/compile-fail/tail-typeck.rs b/src/test/compile-fail/tail-typeck.rs index a934bbe61c4..9c1d318d588 100644 --- a/src/test/compile-fail/tail-typeck.rs +++ b/src/test/compile-fail/tail-typeck.rs @@ -12,6 +12,6 @@ fn f() -> isize { return g(); } -fn g() -> usize { return 0us; } +fn g() -> usize { return 0_usize; } fn main() { let y = f(); } diff --git a/src/test/compile-fail/unboxed-closure-illegal-move.rs b/src/test/compile-fail/unboxed-closure-illegal-move.rs index 224cbc2bef3..800126450c9 100644 --- a/src/test/compile-fail/unboxed-closure-illegal-move.rs +++ b/src/test/compile-fail/unboxed-closure-illegal-move.rs @@ -22,28 +22,28 @@ fn to_fn_once>(f: F) -> F { f } fn main() { // By-ref cases { - let x = box 0us; + let x = box 0_usize; let f = to_fn(|| drop(x)); //~ ERROR cannot move } { - let x = box 0us; + let x = box 0_usize; let f = to_fn_mut(|| drop(x)); //~ ERROR cannot move } { - let x = box 0us; + let x = box 0_usize; let f = to_fn_once(|| drop(x)); // OK -- FnOnce } // By-value cases { - let x = box 0us; + let x = box 0_usize; let f = to_fn(move || drop(x)); //~ ERROR cannot move } { - let x = box 0us; + let x = box 0_usize; let f = to_fn_mut(move || drop(x)); //~ ERROR cannot move } { - let x = box 0us; + let x = box 0_usize; let f = to_fn_once(move || drop(x)); // this one is ok } } diff --git a/src/test/compile-fail/unboxed-closure-immutable-capture.rs b/src/test/compile-fail/unboxed-closure-immutable-capture.rs index 145b2bfaedd..b40a91181ad 100644 --- a/src/test/compile-fail/unboxed-closure-immutable-capture.rs +++ b/src/test/compile-fail/unboxed-closure-immutable-capture.rs @@ -17,7 +17,7 @@ fn set(x: &mut usize) { *x = 0; } fn main() { - let x = 0us; + let x = 0_usize; move || x = 1; //~ ERROR cannot assign move || set(&mut x); //~ ERROR cannot borrow move || x = 1; //~ ERROR cannot assign diff --git a/src/test/compile-fail/unboxed-closure-region.rs b/src/test/compile-fail/unboxed-closure-region.rs index 98ac54de8ad..59c84953718 100644 --- a/src/test/compile-fail/unboxed-closure-region.rs +++ b/src/test/compile-fail/unboxed-closure-region.rs @@ -14,7 +14,7 @@ // reference cannot escape the region of that variable. fn main() { let _f = { - let x = 0us; + let x = 0_usize; || x //~ ERROR cannot infer an appropriate lifetime due to conflicting requirements }; } diff --git a/src/test/compile-fail/unboxed-closures-borrow-conflict.rs b/src/test/compile-fail/unboxed-closures-borrow-conflict.rs index 0bdc261e8c8..1191cfa2600 100644 --- a/src/test/compile-fail/unboxed-closures-borrow-conflict.rs +++ b/src/test/compile-fail/unboxed-closures-borrow-conflict.rs @@ -14,7 +14,7 @@ // cause borrow conflicts. fn main() { - let mut x = 0us; + let mut x = 0_usize; let f = || x += 1; let _y = x; //~ ERROR cannot use `x` because it was mutably borrowed } diff --git a/src/test/compile-fail/unboxed-closures-type-mismatch.rs b/src/test/compile-fail/unboxed-closures-type-mismatch.rs index e1192b22485..91182393ac8 100644 --- a/src/test/compile-fail/unboxed-closures-type-mismatch.rs +++ b/src/test/compile-fail/unboxed-closures-type-mismatch.rs @@ -14,6 +14,6 @@ use std::ops::FnMut; pub fn main() { let mut f = |x: isize, y: isize| -> isize { x + y }; - let z = f(1us, 2); //~ ERROR mismatched types + let z = f(1_usize, 2); //~ ERROR mismatched types println!("{}", z); } diff --git a/src/test/compile-fail/unique-unique-kind.rs b/src/test/compile-fail/unique-unique-kind.rs index d45a31abcb7..046337c33f0 100644 --- a/src/test/compile-fail/unique-unique-kind.rs +++ b/src/test/compile-fail/unique-unique-kind.rs @@ -12,7 +12,7 @@ use std::rc::Rc; -fn f(_i: T) { +fn f(__isize: T) { } fn main() { diff --git a/src/test/compile-fail/unique-vec-res.rs b/src/test/compile-fail/unique-vec-res.rs index b9ddc3f4de9..91a41ad6a49 100644 --- a/src/test/compile-fail/unique-vec-res.rs +++ b/src/test/compile-fail/unique-vec-res.rs @@ -28,7 +28,7 @@ impl<'a> Drop for r<'a> { } } -fn f(_i: Vec , _j: Vec ) { +fn f(__isize: Vec , _j: Vec ) { } fn clone(t: &T) -> T { t.clone() } diff --git a/src/test/compile-fail/unreachable-arm.rs b/src/test/compile-fail/unreachable-arm.rs index 6434b0bde8d..eb5ffeaf888 100644 --- a/src/test/compile-fail/unreachable-arm.rs +++ b/src/test/compile-fail/unreachable-arm.rs @@ -15,4 +15,4 @@ enum foo { a(Box, isize), b(usize), } -fn main() { match foo::b(1us) { foo::b(_) | foo::a(box _, 1) => { } foo::a(_, 1) => { } } } +fn main() { match foo::b(1_usize) { foo::b(_) | foo::a(box _, 1) => { } foo::a(_, 1) => { } } } diff --git a/src/test/compile-fail/vtable-res-trait-param.rs b/src/test/compile-fail/vtable-res-trait-param.rs index c21d8274da0..cc6ff2d8ebc 100644 --- a/src/test/compile-fail/vtable-res-trait-param.rs +++ b/src/test/compile-fail/vtable-res-trait-param.rs @@ -23,7 +23,7 @@ impl TraitB for isize { } fn call_it(b: B) -> isize { - let y = 4us; + let y = 4_usize; b.gimme_an_a(y) //~ ERROR the trait `TraitA` is not implemented } diff --git a/src/test/run-fail/binop-panic.rs b/src/test/run-fail/binop-panic.rs index ac85b218ec0..159c33198a6 100644 --- a/src/test/run-fail/binop-panic.rs +++ b/src/test/run-fail/binop-panic.rs @@ -10,4 +10,4 @@ // error-pattern:quux fn my_err(s: String) -> ! { println!("{}", s); panic!("quux"); } -fn main() { 3u == my_err("bye".to_string()); } +fn main() { 3_usize == my_err("bye".to_string()); } diff --git a/src/test/run-fail/bug-2470-bounds-check-overflow-2.rs b/src/test/run-fail/bug-2470-bounds-check-overflow-2.rs index 06712841823..6dd329b7295 100644 --- a/src/test/run-fail/bug-2470-bounds-check-overflow-2.rs +++ b/src/test/run-fail/bug-2470-bounds-check-overflow-2.rs @@ -14,14 +14,14 @@ use std::uint; fn main() { - let x = vec!(1u,2u,3u); + let x = vec!(1_usize,2_usize,3_usize); // This should cause a bounds-check panic, but may not if we do our // bounds checking by comparing a scaled index value to the vector's // length (in bytes), because the scaling of the index will cause it to // wrap around to a small number. - let idx = uint::MAX & !(uint::MAX >> 1u); + let idx = uint::MAX & !(uint::MAX >> 1_usize); println!("ov2 idx = 0x%x", idx); // This should panic. diff --git a/src/test/run-fail/bug-2470-bounds-check-overflow-3.rs b/src/test/run-fail/bug-2470-bounds-check-overflow-3.rs index 72e9c4849c6..ec7fde17101 100644 --- a/src/test/run-fail/bug-2470-bounds-check-overflow-3.rs +++ b/src/test/run-fail/bug-2470-bounds-check-overflow-3.rs @@ -15,7 +15,7 @@ use std::u64; #[cfg(target_arch="x86")] fn main() { - let x = vec!(1u,2u,3u); + let x = vec!(1_usize,2_usize,3_usize); // This should cause a bounds-check panic, but may not if we do our // bounds checking by truncating the index value to the size of the @@ -23,7 +23,7 @@ fn main() { // This test is only meaningful on 32-bit hosts. - let idx = u64::MAX & !(u64::MAX >> 1u); + let idx = u64::MAX & !(u64::MAX >> 1_usize); println!("ov3 idx = 0x%8.8x%8.8x", (idx >> 32) as uint, idx as uint); @@ -35,6 +35,6 @@ fn main() { #[cfg(any(target_arch="x86_64", target_arch = "aarch64"))] fn main() { // This version just panics anyways, for symmetry on 64-bit hosts. - let x = vec!(1u,2u,3u); + let x = vec!(1_usize,2_usize,3_usize); error!("ov3 0x%x", x[200]); } diff --git a/src/test/run-fail/bug-2470-bounds-check-overflow.rs b/src/test/run-fail/bug-2470-bounds-check-overflow.rs index f8686d0dbb5..e48d749d945 100644 --- a/src/test/run-fail/bug-2470-bounds-check-overflow.rs +++ b/src/test/run-fail/bug-2470-bounds-check-overflow.rs @@ -20,7 +20,7 @@ fn main() { // address of the 0th cell in the array (even though the index is // huge). - let x = vec!(1u,2u,3u); + let x = vec!(1_usize,2_usize,3_usize); let base = x.as_ptr() as uint; let idx = base / mem::size_of::(); diff --git a/src/test/run-fail/die-macro-expr.rs b/src/test/run-fail/die-macro-expr.rs index 2014a108b3d..f2253b7342e 100644 --- a/src/test/run-fail/die-macro-expr.rs +++ b/src/test/run-fail/die-macro-expr.rs @@ -11,5 +11,5 @@ // error-pattern:test fn main() { - let _i: int = panic!("test"); + let __isize: int = panic!("test"); } diff --git a/src/test/run-fail/extern-panic.rs b/src/test/run-fail/extern-panic.rs index f45c36023d2..225ce5a741b 100644 --- a/src/test/run-fail/extern-panic.rs +++ b/src/test/run-fail/extern-panic.rs @@ -26,10 +26,10 @@ mod rustrt { } extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { - if data == 1u { + if data == 1_usize { data } else { - count(data - 1u) + count(data - 1u) + count(data - 1_usize) + count(data - 1_usize) } } @@ -41,9 +41,9 @@ fn count(n: uint) -> uint { } fn main() { - for _ in 0..10u { + for _ in 0..10_usize { task::spawn(move|| { - let result = count(5u); + let result = count(5_usize); println!("result = %?", result); panic!(); }); diff --git a/src/test/run-fail/for-each-loop-panic.rs b/src/test/run-fail/for-each-loop-panic.rs index 6cad55e6358..a1a760c040c 100644 --- a/src/test/run-fail/for-each-loop-panic.rs +++ b/src/test/run-fail/for-each-loop-panic.rs @@ -10,4 +10,4 @@ // error-pattern:moop -fn main() { for _ in 0u..10u { panic!("moop"); } } +fn main() { for _ in 0_usize..10_usize { panic!("moop"); } } diff --git a/src/test/run-fail/if-check-panic.rs b/src/test/run-fail/if-check-panic.rs index 1ead81b0091..19a57db5ec7 100644 --- a/src/test/run-fail/if-check-panic.rs +++ b/src/test/run-fail/if-check-panic.rs @@ -10,9 +10,9 @@ // error-pattern:Number is odd fn even(x: uint) -> bool { - if x < 2u { + if x < 2_usize { return false; - } else if x == 2u { return true; } else { return even(x - 2u); } + } else if x == 2_usize { return true; } else { return even(x - 2_usize); } } fn foo(x: uint) { @@ -23,4 +23,4 @@ fn foo(x: uint) { } } -fn main() { foo(3u); } +fn main() { foo(3_usize); } 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 c9e4b41c812..b4ec986ef25 100644 --- a/src/test/run-make/graphviz-flowgraph/f20.dot-expected.dot +++ b/src/test/run-make/graphviz-flowgraph/f20.dot-expected.dot @@ -1,17 +1,17 @@ digraph block { N0[label="entry"]; N1[label="exit"]; - N2[label="expr 2us"]; - N3[label="expr 0us"]; - N4[label="expr 20us"]; - N5[label="expr [2us, 0us, 20us]"]; + N2[label="expr 2usize"]; + N3[label="expr 0usize"]; + N4[label="expr 20usize"]; + N5[label="expr [2usize, 0usize, 20usize]"]; N6[label="local v"]; - N7[label="stmt let v = [2us, 0us, 20us];"]; + N7[label="stmt let v = [2usize, 0usize, 20usize];"]; N8[label="expr v"]; - N9[label="expr 20us"]; - N10[label="expr v[20us]"]; - N11[label="stmt v[20us];"]; - N12[label="block { let v = [2us, 0us, 20us]; v[20us]; }"]; + N9[label="expr 20usize"]; + N10[label="expr v[20usize]"]; + N11[label="stmt v[20usize];"]; + N12[label="block { let v = [2usize, 0usize, 20usize]; v[20usize]; }"]; 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 3ca55cb521b..d65de18b547 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 = [2us, 0us, 20us]; - v[20us]; + let v = [2_usize, 0_usize, 20_usize]; + v[20_usize]; } diff --git a/src/test/run-make/save-analysis/foo.rs b/src/test/run-make/save-analysis/foo.rs index 9fb2c6aa67a..db70a245232 100644 --- a/src/test/run-make/save-analysis/foo.rs +++ b/src/test/run-make/save-analysis/foo.rs @@ -45,11 +45,11 @@ fn test_alias(i: Option<::Item>) { fn foo(x: &Float) {} let _: Option = from_i32(45); - let x = 42us; + let x = 42_usize; myflate::deflate_bytes(&[]); - let x = (3, 4us); + let x = (3, 4_usize); let y = x.1; } diff --git a/src/test/run-make/symbols-are-reasonable/lib.rs b/src/test/run-make/symbols-are-reasonable/lib.rs index 7cfebb31b22..1e0570c95ac 100644 --- a/src/test/run-make/symbols-are-reasonable/lib.rs +++ b/src/test/run-make/symbols-are-reasonable/lib.rs @@ -16,5 +16,5 @@ impl Foo for uint {} pub fn dummy() { // force the vtable to be created - let _x = &1u as &Foo; + let _x = &1_usize as &Foo; } diff --git a/src/test/run-make/unicode-input/multiple_files.rs b/src/test/run-make/unicode-input/multiple_files.rs index 759a1d4aff9..ce3e69918ff 100644 --- a/src/test/run-make/unicode-input/multiple_files.rs +++ b/src/test/run-make/unicode-input/multiple_files.rs @@ -43,11 +43,11 @@ fn main() { .write_str("mod unicode_input_multiple_files_chars;"); } - for _ in 0u..100 { + for _ in 0..100 { { let randoms = tmpdir.join("unicode_input_multiple_files_chars.rs"); let mut w = File::create(&randoms).unwrap(); - for _ in 0u..30 { + for _ in 0..30 { let _ = w.write_char(random_char()); } } diff --git a/src/test/run-make/unicode-input/span_length.rs b/src/test/run-make/unicode-input/span_length.rs index 5dee9104b0f..ef6c799336b 100644 --- a/src/test/run-make/unicode-input/span_length.rs +++ b/src/test/run-make/unicode-input/span_length.rs @@ -38,8 +38,8 @@ fn main() { let tmpdir = Path::new(&args[2]); let main_file = tmpdir.join("span_main.rs"); - for _ in 0u..100 { - let n = thread_rng().gen_range(3u, 20); + for _ in 0..100 { + let n = thread_rng().gen_range(3, 20); { let _ = write!(&mut File::create(&main_file).unwrap(), diff --git a/src/test/run-pass/alias-uninit-value.rs b/src/test/run-pass/alias-uninit-value.rs index fc8c04598ea..b1bebf0b3e6 100644 --- a/src/test/run-pass/alias-uninit-value.rs +++ b/src/test/run-pass/alias-uninit-value.rs @@ -17,7 +17,7 @@ enum sty { ty_nil, } struct RawT {struct_: sty, cname: Option, hash: uint} fn mk_raw_ty(st: sty, cname: Option) -> RawT { - return RawT {struct_: st, cname: cname, hash: 0u}; + return RawT {struct_: st, cname: cname, hash: 0_usize}; } pub fn main() { mk_raw_ty(sty::ty_nil, None::); } diff --git a/src/test/run-pass/asm-in-out-operand.rs b/src/test/run-pass/asm-in-out-operand.rs index ce0fcad40ee..3ac8e4d0ee9 100644 --- a/src/test/run-pass/asm-in-out-operand.rs +++ b/src/test/run-pass/asm-in-out-operand.rs @@ -14,7 +14,7 @@ unsafe fn next_power_of_2(n: u32) -> u32 { let mut tmp = n; asm!("dec $0" : "+rm"(tmp) :: "cc"); - let mut shift = 1u; + let mut shift = 1_usize; while shift <= 16 { asm!( "shr %cl, $2 @@ -42,7 +42,7 @@ pub fn main() { "shl $2, $1 add $3, $1 mov $1, $0" - : "=r"(x), "+r"(y) : "i"(3u), "ir"(7u) : "cc" + : "=r"(x), "+r"(y) : "i"(3_usize), "ir"(7_usize) : "cc" ); } assert_eq!(x, 47); diff --git a/src/test/run-pass/asm-out-assign.rs b/src/test/run-pass/asm-out-assign.rs index f7853908467..0f6fec133d1 100644 --- a/src/test/run-pass/asm-out-assign.rs +++ b/src/test/run-pass/asm-out-assign.rs @@ -15,7 +15,7 @@ pub fn main() { let x: int; unsafe { // Treat the output as initialization. - asm!("mov $1, $0" : "=r"(x) : "r"(5u)); + asm!("mov $1, $0" : "=r"(x) : "r"(5_usize)); } assert_eq!(x, 5); diff --git a/src/test/run-pass/associated-types-constant-type.rs b/src/test/run-pass/associated-types-constant-type.rs index 68b49af0d3b..57e9230336c 100644 --- a/src/test/run-pass/associated-types-constant-type.rs +++ b/src/test/run-pass/associated-types-constant-type.rs @@ -35,5 +35,5 @@ fn get(x: int) -> ::Opposite { fn main() { let x = get(22); - assert_eq!(22u, x); + assert_eq!(22_usize, x); } diff --git a/src/test/run-pass/associated-types-return.rs b/src/test/run-pass/associated-types-return.rs index 72290921854..fe24ab6bbeb 100644 --- a/src/test/run-pass/associated-types-return.rs +++ b/src/test/run-pass/associated-types-return.rs @@ -43,7 +43,7 @@ fn foo2(x: I) -> ::A { pub fn main() { let a = 42; - assert!(foo2(a) == 42u); + assert!(foo2(a) == 42_usize); let a = Bar; assert!(foo2(a) == 43); diff --git a/src/test/run-pass/associated-types-sugar-path.rs b/src/test/run-pass/associated-types-sugar-path.rs index ea1df6658fd..3b70e941ac5 100644 --- a/src/test/run-pass/associated-types-sugar-path.rs +++ b/src/test/run-pass/associated-types-sugar-path.rs @@ -40,5 +40,5 @@ impl C for B { } pub fn main() { - let z: uint = bar(2, 4u); + let z: uint = bar(2, 4_usize); } diff --git a/src/test/run-pass/auto-encode.rs b/src/test/run-pass/auto-encode.rs index 1fcbae833dc..7c126fc420a 100644 --- a/src/test/run-pass/auto-encode.rs +++ b/src/test/run-pass/auto-encode.rs @@ -131,19 +131,19 @@ enum Quark { enum CLike { A, B, C } pub fn main() { - let a = &Plus(@Minus(@Val(3u), @Val(10u)), @Plus(@Val(22u), @Val(5u))); + let a = &Plus(@Minus(@Val(3_usize), @Val(10_usize)), @Plus(@Val(22_usize), @Val(5_usize))); test_rbml(a); - let a = &Spanned {lo: 0u, hi: 5u, node: 22u}; + let a = &Spanned {lo: 0_usize, hi: 5_usize, node: 22_usize}; test_rbml(a); - let a = &Point {x: 3u, y: 5u}; + let a = &Point {x: 3_usize, y: 5_usize}; test_rbml(a); - let a = &Top(22u); + let a = &Top(22_usize); test_rbml(a); - let a = &Bottom(222u); + let a = &Bottom(222_usize); test_rbml(a); let a = &A; diff --git a/src/test/run-pass/autoderef-method-on-trait.rs b/src/test/run-pass/autoderef-method-on-trait.rs index 876fc123f48..9e88eb6da6a 100644 --- a/src/test/run-pass/autoderef-method-on-trait.rs +++ b/src/test/run-pass/autoderef-method-on-trait.rs @@ -16,10 +16,10 @@ trait double { } impl double for uint { - fn double(self: Box) -> uint { *self * 2u } + fn double(self: Box) -> uint { *self * 2_usize } } pub fn main() { - let x = box() (box 3u as Box); - assert_eq!(x.double(), 6u); + let x = box() (box 3_usize as Box); + assert_eq!(x.double(), 6_usize); } diff --git a/src/test/run-pass/autoderef-method-priority.rs b/src/test/run-pass/autoderef-method-priority.rs index f5d5c81117e..67dd25ddc53 100644 --- a/src/test/run-pass/autoderef-method-priority.rs +++ b/src/test/run-pass/autoderef-method-priority.rs @@ -20,10 +20,10 @@ impl double for uint { } impl double for Box { - fn double(self) -> uint { *self * 2u } + fn double(self) -> uint { *self * 2_usize } } pub fn main() { - let x = box 3u; - assert_eq!(x.double(), 6u); + let x = box 3_usize; + assert_eq!(x.double(), 6_usize); } diff --git a/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs b/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs index 282cf62190c..6437c78161c 100644 --- a/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs +++ b/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs @@ -16,10 +16,10 @@ trait double { } impl double for Box { - fn double(self: Box>) -> uint { **self * 2u } + fn double(self: Box>) -> uint { **self * 2_usize } } pub fn main() { - let x = box box box box box 3u; - assert_eq!(x.double(), 6u); + let x = box box box box box 3_usize; + assert_eq!(x.double(), 6_usize); } diff --git a/src/test/run-pass/autoderef-method-twice.rs b/src/test/run-pass/autoderef-method-twice.rs index eb44e3b52b9..8cbc151f0cd 100644 --- a/src/test/run-pass/autoderef-method-twice.rs +++ b/src/test/run-pass/autoderef-method-twice.rs @@ -16,10 +16,10 @@ trait double { } impl double for uint { - fn double(self: Box) -> uint { *self * 2u } + fn double(self: Box) -> uint { *self * 2_usize } } pub fn main() { - let x = box box 3u; - assert_eq!(x.double(), 6u); + let x = box box 3_usize; + assert_eq!(x.double(), 6_usize); } diff --git a/src/test/run-pass/autoderef-method.rs b/src/test/run-pass/autoderef-method.rs index 4bbb17c6dd6..c8fa3c9fd5f 100644 --- a/src/test/run-pass/autoderef-method.rs +++ b/src/test/run-pass/autoderef-method.rs @@ -16,10 +16,10 @@ trait double { } impl double for uint { - fn double(self: Box) -> uint { *self * 2u } + fn double(self: Box) -> uint { *self * 2_usize } } pub fn main() { - let x = box 3u; - assert_eq!(x.double(), 6u); + let x = box 3_usize; + assert_eq!(x.double(), 6_usize); } diff --git a/src/test/run-pass/autoref-intermediate-types-issue-3585.rs b/src/test/run-pass/autoref-intermediate-types-issue-3585.rs index e026ac9dcba..87157b9334f 100644 --- a/src/test/run-pass/autoref-intermediate-types-issue-3585.rs +++ b/src/test/run-pass/autoref-intermediate-types-issue-3585.rs @@ -29,6 +29,6 @@ impl Foo for uint { } pub fn main() { - let x = box 3u; + let x = box 3_usize; assert_eq!(x.foo(), "box 3".to_string()); } diff --git a/src/test/run-pass/binops.rs b/src/test/run-pass/binops.rs index 30f10d23563..b36eb4bf2f6 100644 --- a/src/test/run-pass/binops.rs +++ b/src/test/run-pass/binops.rs @@ -44,9 +44,9 @@ fn test_bool() { fn test_ptr() { unsafe { - let p1: *const u8 = ::std::mem::transmute(0u); - let p2: *const u8 = ::std::mem::transmute(0u); - let p3: *const u8 = ::std::mem::transmute(1u); + let p1: *const u8 = ::std::mem::transmute(0_usize); + let p2: *const u8 = ::std::mem::transmute(0_usize); + let p3: *const u8 = ::std::mem::transmute(1_usize); assert_eq!(p1, p2); assert!(p1 != p3); diff --git a/src/test/run-pass/bitwise.rs b/src/test/run-pass/bitwise.rs index 8a57279e866..8418681b6b1 100644 --- a/src/test/run-pass/bitwise.rs +++ b/src/test/run-pass/bitwise.rs @@ -11,12 +11,12 @@ #[cfg(any(target_arch = "x86", target_arch = "arm"))] fn target() { - assert_eq!(-1000 as uint >> 3u, 536870787u); + assert_eq!(-1000 as uint >> 3_usize, 536870787_usize); } #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] fn target() { - assert_eq!(-1000 as uint >> 3u, 2305843009213693827u); + assert_eq!(-1000 as uint >> 3_usize, 2305843009213693827_usize); } fn general() { @@ -29,12 +29,12 @@ fn general() { println!("{}", b); assert_eq!(b, 1); assert_eq!(a, 2); - assert_eq!(!0xf0i & 0xff, 0xf); - assert_eq!(0xf0i | 0xf, 0xff); - assert_eq!(0xfi << 4, 0xf0); - assert_eq!(0xf0i >> 4, 0xf); + assert_eq!(!0xf0_isize & 0xff, 0xf); + assert_eq!(0xf0_isize | 0xf, 0xff); + assert_eq!(0xf_isize << 4, 0xf0); + assert_eq!(0xf0_isize >> 4, 0xf); assert_eq!(-16 >> 2, -4); - assert_eq!(0b1010_1010i | 0b0101_0101, 0xff); + assert_eq!(0b1010_1010_isize | 0b0101_0101, 0xff); } pub fn main() { diff --git a/src/test/run-pass/block-arg-call-as.rs b/src/test/run-pass/block-arg-call-as.rs index 6c54f33fbe6..d319aaa2f8e 100644 --- a/src/test/run-pass/block-arg-call-as.rs +++ b/src/test/run-pass/block-arg-call-as.rs @@ -13,6 +13,6 @@ fn asBlock(f: F) -> uint where F: FnOnce() -> uint { } pub fn main() { - let x = asBlock(|| 22u); - assert_eq!(x, 22u); + let x = asBlock(|| 22_usize); + assert_eq!(x, 22_usize); } diff --git a/src/test/run-pass/borrowck-mut-uniq.rs b/src/test/run-pass/borrowck-mut-uniq.rs index 747aca53324..2dbaec8fbb1 100644 --- a/src/test/run-pass/borrowck-mut-uniq.rs +++ b/src/test/run-pass/borrowck-mut-uniq.rs @@ -26,7 +26,7 @@ fn add_int(x: &mut Ints, v: int) { fn iter_ints(x: &Ints, mut f: F) -> bool where F: FnMut(&int) -> bool { let l = x.values.len(); - (0u..l).all(|i| f(&x.values[i])) + (0_usize..l).all(|i| f(&x.values[i])) } pub fn main() { diff --git a/src/test/run-pass/byte-literals.rs b/src/test/run-pass/byte-literals.rs index e2f9dcb8efa..874dbdc662b 100644 --- a/src/test/run-pass/byte-literals.rs +++ b/src/test/run-pass/byte-literals.rs @@ -53,9 +53,9 @@ pub fn main() { let buf = vec!(97u8, 98, 99, 100); assert_eq!(match &buf[0..3] { - b"def" => 1u, - b"abc" => 2u, - _ => 3u + b"def" => 1_usize, + b"abc" => 2_usize, + _ => 3_usize }, 2); let expected: &[_] = &[97u8, 92u8, 110u8]; diff --git a/src/test/run-pass/capture-clauses-boxed-closures.rs b/src/test/run-pass/capture-clauses-boxed-closures.rs index 5e696566bfa..1a85797fa6d 100644 --- a/src/test/run-pass/capture-clauses-boxed-closures.rs +++ b/src/test/run-pass/capture-clauses-boxed-closures.rs @@ -15,8 +15,8 @@ fn each(x: &[T], mut f: F) where F: FnMut(&T) { } fn main() { - let mut sum = 0u; - let elems = [ 1u, 2, 3, 4, 5 ]; + let mut sum = 0_usize; + let elems = [ 1_usize, 2, 3, 4, 5 ]; each(&elems, |val| sum += *val); assert_eq!(sum, 15); } diff --git a/src/test/run-pass/capture-clauses-unboxed-closures.rs b/src/test/run-pass/capture-clauses-unboxed-closures.rs index ca315b7a9f1..dd417f1a9eb 100644 --- a/src/test/run-pass/capture-clauses-unboxed-closures.rs +++ b/src/test/run-pass/capture-clauses-unboxed-closures.rs @@ -17,8 +17,8 @@ fn each<'a,T,F:FnMut(&'a T)>(x: &'a [T], mut f: F) { } fn main() { - let mut sum = 0u; - let elems = [ 1u, 2, 3, 4, 5 ]; + let mut sum = 0_usize; + let elems = [ 1_usize, 2, 3, 4, 5 ]; each(&elems, |val: &uint| sum += *val); assert_eq!(sum, 15); } diff --git a/src/test/run-pass/cci_borrow.rs b/src/test/run-pass/cci_borrow.rs index ef5ee5aa3b4..00c600ed006 100644 --- a/src/test/run-pass/cci_borrow.rs +++ b/src/test/run-pass/cci_borrow.rs @@ -17,8 +17,8 @@ extern crate cci_borrow_lib; use cci_borrow_lib::foo; pub fn main() { - let p = box 22u; + let p = box 22_usize; let r = foo(&*p); println!("r={}", r); - assert_eq!(r, 22u); + assert_eq!(r, 22_usize); } diff --git a/src/test/run-pass/cci_impl_exe.rs b/src/test/run-pass/cci_impl_exe.rs index 8a291febb6d..c4b55b9962f 100644 --- a/src/test/run-pass/cci_impl_exe.rs +++ b/src/test/run-pass/cci_impl_exe.rs @@ -17,7 +17,7 @@ pub fn main() { //let bt0 = sys::frame_address(); //println!("%?", bt0); - 3u.to(10u, |i| { + 3_usize.to(10_usize, |i| { println!("{}", i); //let bt1 = sys::frame_address(); diff --git a/src/test/run-pass/cci_no_inline_exe.rs b/src/test/run-pass/cci_no_inline_exe.rs index 2f02fc9acb9..2040bd7ad71 100644 --- a/src/test/run-pass/cci_no_inline_exe.rs +++ b/src/test/run-pass/cci_no_inline_exe.rs @@ -21,7 +21,7 @@ pub fn main() { // actually working. //let bt0 = sys::frame_address(); //println!("%?", bt0); - iter(vec!(1u, 2u, 3u), |i| { + iter(vec!(1_usize, 2_usize, 3_usize), |i| { println!("{}", i); //let bt1 = sys::frame_address(); diff --git a/src/test/run-pass/class-cast-to-trait-cross-crate-2.rs b/src/test/run-pass/class-cast-to-trait-cross-crate-2.rs index e6cae99067e..9a388c9bc24 100644 --- a/src/test/run-pass/class-cast-to-trait-cross-crate-2.rs +++ b/src/test/run-pass/class-cast-to-trait-cross-crate-2.rs @@ -25,6 +25,6 @@ fn print_out(thing: Box, expected: String) { } pub fn main() { - let nyan: Box = box cat(0u, 2, "nyan".to_string()) as Box; + let nyan: Box = box cat(0_usize, 2, "nyan".to_string()) as Box; print_out(nyan, "nyan".to_string()); } diff --git a/src/test/run-pass/class-cast-to-trait-multiple-types.rs b/src/test/run-pass/class-cast-to-trait-multiple-types.rs index 8aca51cab54..4f1654e6031 100644 --- a/src/test/run-pass/class-cast-to-trait-multiple-types.rs +++ b/src/test/run-pass/class-cast-to-trait-multiple-types.rs @@ -22,11 +22,11 @@ struct dog { impl dog { fn bark(&mut self) -> int { println!("Woof {} {}", self.barks, self.volume); - self.barks += 1u; - if self.barks % 3u == 0u { + self.barks += 1_usize; + if self.barks % 3_usize == 0_usize { self.volume += 1; } - if self.barks % 10u == 0u { + if self.barks % 10_usize == 0_usize { self.volume -= 2; } println!("Grrr {} {}", self.barks, self.volume); @@ -43,7 +43,7 @@ impl noisy for dog { fn dog() -> dog { dog { volume: 0, - barks: 0u + barks: 0_usize } } @@ -70,8 +70,8 @@ impl cat { impl cat { fn meow(&mut self) -> uint { println!("Meow"); - self.meows += 1u; - if self.meows % 5u == 0u { + self.meows += 1_usize; + if self.meows % 5_usize == 0_usize { self.how_hungry += 1; } self.meows @@ -88,14 +88,14 @@ fn cat(in_x: uint, in_y: int, in_name: String) -> cat { fn annoy_neighbors(critter: &mut noisy) { - for _i in 0u..10 { critter.speak(); } + for _i in 0_usize..10 { critter.speak(); } } pub fn main() { - let mut nyan: cat = cat(0u, 2, "nyan".to_string()); + let mut nyan: cat = cat(0_usize, 2, "nyan".to_string()); let mut whitefang: dog = dog(); annoy_neighbors(&mut nyan); annoy_neighbors(&mut whitefang); - assert_eq!(nyan.meow_count(), 10u); + assert_eq!(nyan.meow_count(), 10_usize); assert_eq!(whitefang.volume, 1); } diff --git a/src/test/run-pass/class-cast-to-trait.rs b/src/test/run-pass/class-cast-to-trait.rs index 85764f8cbbf..476594c270e 100644 --- a/src/test/run-pass/class-cast-to-trait.rs +++ b/src/test/run-pass/class-cast-to-trait.rs @@ -42,8 +42,8 @@ impl cat { impl cat { fn meow(&mut self) { println!("Meow"); - self.meows += 1u; - if self.meows % 5u == 0u { + self.meows += 1_usize; + if self.meows % 5_usize == 0_usize { self.how_hungry += 1; } } @@ -59,7 +59,7 @@ fn cat(in_x : uint, in_y : int, in_name: String) -> cat { pub fn main() { - let mut nyan = cat(0u, 2, "nyan".to_string()); + let mut nyan = cat(0_usize, 2, "nyan".to_string()); let mut nyan: &mut noisy = &mut nyan; nyan.speak(); } diff --git a/src/test/run-pass/class-dtor.rs b/src/test/run-pass/class-dtor.rs index 8ee382eaa38..14247ad7754 100644 --- a/src/test/run-pass/class-dtor.rs +++ b/src/test/run-pass/class-dtor.rs @@ -21,7 +21,7 @@ impl Drop for cat { fn cat(done: extern fn(uint)) -> cat { cat { - meows: 0u, + meows: 0_usize, done: done } } diff --git a/src/test/run-pass/class-exports.rs b/src/test/run-pass/class-exports.rs index 80f8ed93637..4c7d0e6951a 100644 --- a/src/test/run-pass/class-exports.rs +++ b/src/test/run-pass/class-exports.rs @@ -27,7 +27,7 @@ mod kitty { pub fn cat(in_name: String) -> cat { cat { name: in_name, - meows: 0u + meows: 0_usize } } } diff --git a/src/test/run-pass/class-impl-very-parameterized-trait.rs b/src/test/run-pass/class-impl-very-parameterized-trait.rs index 83e7df1c711..c3ced512afa 100644 --- a/src/test/run-pass/class-impl-very-parameterized-trait.rs +++ b/src/test/run-pass/class-impl-very-parameterized-trait.rs @@ -103,11 +103,11 @@ impl cat { pub fn main() { let mut nyan: cat = cat::new(0, 2, "nyan".to_string()); - for _ in 1u..5 { nyan.speak(); } + for _ in 1_usize..5 { nyan.speak(); } assert!(*nyan.find(&1).unwrap() == "nyan".to_string()); assert_eq!(nyan.find(&10), None); let mut spotty: cat = cat::new(2, 57, cat_type::tuxedo); - for _ in 0u..6 { spotty.speak(); } + for _ in 0_usize..6 { spotty.speak(); } assert_eq!(spotty.len(), 8); assert!((spotty.contains_key(&2))); assert_eq!(spotty.get(&3), &cat_type::tuxedo); diff --git a/src/test/run-pass/class-implement-trait-cross-crate.rs b/src/test/run-pass/class-implement-trait-cross-crate.rs index b2804a41789..bd05221b8c7 100644 --- a/src/test/run-pass/class-implement-trait-cross-crate.rs +++ b/src/test/run-pass/class-implement-trait-cross-crate.rs @@ -40,8 +40,8 @@ impl noisy for cat { impl cat { fn meow(&mut self) { println!("Meow"); - self.meows += 1u; - if self.meows % 5u == 0u { + self.meows += 1_usize; + if self.meows % 5_usize == 0_usize { self.how_hungry += 1; } } @@ -57,9 +57,9 @@ fn cat(in_x : uint, in_y : int, in_name: String) -> cat { pub fn main() { - let mut nyan = cat(0u, 2, "nyan".to_string()); + let mut nyan = cat(0_usize, 2, "nyan".to_string()); nyan.eat(); assert!((!nyan.eat())); - for _ in 1u..10u { nyan.speak(); }; + for _ in 1_usize..10_usize { nyan.speak(); }; assert!((nyan.eat())); } diff --git a/src/test/run-pass/class-implement-traits.rs b/src/test/run-pass/class-implement-traits.rs index 172df8c2afd..87e6e5f675e 100644 --- a/src/test/run-pass/class-implement-traits.rs +++ b/src/test/run-pass/class-implement-traits.rs @@ -24,8 +24,8 @@ struct cat { impl cat { fn meow(&mut self) { println!("Meow"); - self.meows += 1u; - if self.meows % 5u == 0u { + self.meows += 1_usize; + if self.meows % 5_usize == 0_usize { self.how_hungry += 1; } } @@ -62,10 +62,10 @@ fn make_speak(mut c: C) { } pub fn main() { - let mut nyan = cat(0u, 2, "nyan".to_string()); + let mut nyan = cat(0_usize, 2, "nyan".to_string()); nyan.eat(); assert!((!nyan.eat())); - for _ in 1u..10u { + for _ in 1_usize..10_usize { make_speak(nyan.clone()); } } diff --git a/src/test/run-pass/class-method-cross-crate.rs b/src/test/run-pass/class-method-cross-crate.rs index e05ed750b5d..47cc500e44e 100644 --- a/src/test/run-pass/class-method-cross-crate.rs +++ b/src/test/run-pass/class-method-cross-crate.rs @@ -13,8 +13,8 @@ extern crate cci_class_2; use cci_class_2::kitties::cat; pub fn main() { - let nyan : cat = cat(52u, 99); - let kitty = cat(1000u, 2); + let nyan : cat = cat(52_usize, 99); + let kitty = cat(1000_usize, 2); assert_eq!(nyan.how_hungry, 99); assert_eq!(kitty.how_hungry, 2); nyan.speak(); diff --git a/src/test/run-pass/class-methods-cross-crate.rs b/src/test/run-pass/class-methods-cross-crate.rs index 4ff28700777..d62a726dcdd 100644 --- a/src/test/run-pass/class-methods-cross-crate.rs +++ b/src/test/run-pass/class-methods-cross-crate.rs @@ -13,10 +13,10 @@ extern crate cci_class_3; use cci_class_3::kitties::cat; pub fn main() { - let mut nyan : cat = cat(52u, 99); - let kitty = cat(1000u, 2); + let mut nyan : cat = cat(52_usize, 99); + let kitty = cat(1000_usize, 2); assert_eq!(nyan.how_hungry, 99); assert_eq!(kitty.how_hungry, 2); nyan.speak(); - assert_eq!(nyan.meow_count(), 53u); + assert_eq!(nyan.meow_count(), 53_usize); } diff --git a/src/test/run-pass/class-methods.rs b/src/test/run-pass/class-methods.rs index 25a2009bb9a..18fb03ec935 100644 --- a/src/test/run-pass/class-methods.rs +++ b/src/test/run-pass/class-methods.rs @@ -15,7 +15,7 @@ struct cat { } impl cat { - pub fn speak(&mut self) { self.meows += 1u; } + pub fn speak(&mut self) { self.meows += 1_usize; } pub fn meow_count(&mut self) -> uint { self.meows } } @@ -27,10 +27,10 @@ fn cat(in_x: uint, in_y: int) -> cat { } pub fn main() { - let mut nyan: cat = cat(52u, 99); - let kitty = cat(1000u, 2); + let mut nyan: cat = cat(52_usize, 99); + let kitty = cat(1000_usize, 2); assert_eq!(nyan.how_hungry, 99); assert_eq!(kitty.how_hungry, 2); nyan.speak(); - assert_eq!(nyan.meow_count(), 53u); + assert_eq!(nyan.meow_count(), 53_usize); } diff --git a/src/test/run-pass/class-poly-methods-cross-crate.rs b/src/test/run-pass/class-poly-methods-cross-crate.rs index 94c78522df4..edbbc4f5b34 100644 --- a/src/test/run-pass/class-poly-methods-cross-crate.rs +++ b/src/test/run-pass/class-poly-methods-cross-crate.rs @@ -13,12 +13,12 @@ extern crate cci_class_6; use cci_class_6::kitties::cat; pub fn main() { - let mut nyan : cat = cat::(52u, 99, vec!('p')); - let mut kitty = cat(1000u, 2, vec!("tabby".to_string())); + let mut nyan : cat = cat::(52_usize, 99, vec!('p')); + let mut kitty = cat(1000_usize, 2, vec!("tabby".to_string())); assert_eq!(nyan.how_hungry, 99); assert_eq!(kitty.how_hungry, 2); - nyan.speak(vec!(1u,2u,3u)); - assert_eq!(nyan.meow_count(), 55u); + nyan.speak(vec!(1_usize,2_usize,3_usize)); + assert_eq!(nyan.meow_count(), 55_usize); kitty.speak(vec!("meow".to_string(), "mew".to_string(), "purr".to_string(), "chirp".to_string())); - assert_eq!(kitty.meow_count(), 1004u); + assert_eq!(kitty.meow_count(), 1004_usize); } diff --git a/src/test/run-pass/class-poly-methods.rs b/src/test/run-pass/class-poly-methods.rs index 4f94673a2c0..b529b0a0772 100644 --- a/src/test/run-pass/class-poly-methods.rs +++ b/src/test/run-pass/class-poly-methods.rs @@ -32,12 +32,12 @@ fn cat(in_x : uint, in_y : int, in_info: Vec ) -> cat { } pub fn main() { - let mut nyan : cat = cat::(52u, 99, vec!(9)); - let mut kitty = cat(1000u, 2, vec!("tabby".to_string())); + let mut nyan : cat = cat::(52_usize, 99, vec!(9)); + let mut kitty = cat(1000_usize, 2, vec!("tabby".to_string())); assert_eq!(nyan.how_hungry, 99); assert_eq!(kitty.how_hungry, 2); nyan.speak(vec!(1,2,3)); - assert_eq!(nyan.meow_count(), 55u); + assert_eq!(nyan.meow_count(), 55_usize); kitty.speak(vec!("meow".to_string(), "mew".to_string(), "purr".to_string(), "chirp".to_string())); - assert_eq!(kitty.meow_count(), 1004u); + assert_eq!(kitty.meow_count(), 1004_usize); } diff --git a/src/test/run-pass/class-separate-impl.rs b/src/test/run-pass/class-separate-impl.rs index c2fa98a66df..575c32baeac 100644 --- a/src/test/run-pass/class-separate-impl.rs +++ b/src/test/run-pass/class-separate-impl.rs @@ -39,8 +39,8 @@ impl cat { impl cat { fn meow(&mut self) { println!("Meow"); - self.meows += 1u; - if self.meows % 5u == 0u { + self.meows += 1_usize; + if self.meows % 5_usize == 0_usize { self.how_hungry += 1; } } @@ -67,6 +67,6 @@ fn print_out(thing: Box, expected: String) { } pub fn main() { - let nyan: Box = box cat(0u, 2, "nyan".to_string()) as Box; + let nyan: Box = box cat(0_usize, 2, "nyan".to_string()) as Box; print_out(nyan, "nyan".to_string()); } diff --git a/src/test/run-pass/class-typarams.rs b/src/test/run-pass/class-typarams.rs index 9d4e73da813..68457095944 100644 --- a/src/test/run-pass/class-typarams.rs +++ b/src/test/run-pass/class-typarams.rs @@ -15,7 +15,7 @@ struct cat { } impl cat { - pub fn speak(&mut self) { self.meows += 1u; } + pub fn speak(&mut self) { self.meows += 1_usize; } pub fn meow_count(&mut self) -> uint { self.meows } } @@ -28,6 +28,6 @@ fn cat(in_x : uint, in_y : int) -> cat { pub fn main() { - let _nyan : cat = cat::(52u, 99); - // let mut kitty = cat(1000u, 2); + let _nyan : cat = cat::(52_usize, 99); + // let mut kitty = cat(1000_usize, 2); } diff --git a/src/test/run-pass/classes-cross-crate.rs b/src/test/run-pass/classes-cross-crate.rs index abf6968662c..aae17abcc5f 100644 --- a/src/test/run-pass/classes-cross-crate.rs +++ b/src/test/run-pass/classes-cross-crate.rs @@ -13,9 +13,9 @@ extern crate cci_class_4; use cci_class_4::kitties::cat; pub fn main() { - let mut nyan = cat(0u, 2, "nyan".to_string()); + let mut nyan = cat(0_usize, 2, "nyan".to_string()); nyan.eat(); assert!((!nyan.eat())); - for _ in 1u..10u { nyan.speak(); }; + for _ in 1_usize..10_usize { nyan.speak(); }; assert!((nyan.eat())); } diff --git a/src/test/run-pass/classes-simple-cross-crate.rs b/src/test/run-pass/classes-simple-cross-crate.rs index f6f742fb1df..8037d77807d 100644 --- a/src/test/run-pass/classes-simple-cross-crate.rs +++ b/src/test/run-pass/classes-simple-cross-crate.rs @@ -13,8 +13,8 @@ extern crate cci_class; use cci_class::kitties::cat; pub fn main() { - let nyan : cat = cat(52u, 99); - let kitty = cat(1000u, 2); + let nyan : cat = cat(52_usize, 99); + let kitty = cat(1000_usize, 2); assert_eq!(nyan.how_hungry, 99); assert_eq!(kitty.how_hungry, 2); } diff --git a/src/test/run-pass/classes-simple-method.rs b/src/test/run-pass/classes-simple-method.rs index 6f21afff120..b15d6544fed 100644 --- a/src/test/run-pass/classes-simple-method.rs +++ b/src/test/run-pass/classes-simple-method.rs @@ -26,8 +26,8 @@ fn cat(in_x : uint, in_y : int) -> cat { } pub fn main() { - let mut nyan : cat = cat(52u, 99); - let kitty = cat(1000u, 2); + let mut nyan : cat = cat(52_usize, 99); + let kitty = cat(1000_usize, 2); assert_eq!(nyan.how_hungry, 99); assert_eq!(kitty.how_hungry, 2); nyan.speak(); diff --git a/src/test/run-pass/classes-simple.rs b/src/test/run-pass/classes-simple.rs index 496efc2172e..9bf8df3ce4b 100644 --- a/src/test/run-pass/classes-simple.rs +++ b/src/test/run-pass/classes-simple.rs @@ -22,8 +22,8 @@ fn cat(in_x : uint, in_y : int) -> cat { } pub fn main() { - let nyan : cat = cat(52u, 99); - let kitty = cat(1000u, 2); + let nyan : cat = cat(52_usize, 99); + let kitty = cat(1000_usize, 2); assert_eq!(nyan.how_hungry, 99); assert_eq!(kitty.how_hungry, 2); } diff --git a/src/test/run-pass/classes.rs b/src/test/run-pass/classes.rs index 413e59633cd..4fabca491be 100644 --- a/src/test/run-pass/classes.rs +++ b/src/test/run-pass/classes.rs @@ -33,8 +33,8 @@ impl cat { impl cat { fn meow(&mut self) { println!("Meow"); - self.meows += 1u; - if self.meows % 5u == 0u { + self.meows += 1_usize; + if self.meows % 5_usize == 0_usize { self.how_hungry += 1; } } @@ -49,9 +49,9 @@ fn cat(in_x : uint, in_y : int, in_name: String) -> cat { } pub fn main() { - let mut nyan = cat(0u, 2, "nyan".to_string()); + let mut nyan = cat(0_usize, 2, "nyan".to_string()); nyan.eat(); assert!((!nyan.eat())); - for _ in 1u..10u { nyan.speak(); }; + for _ in 1_usize..10_usize { nyan.speak(); }; assert!((nyan.eat())); } diff --git a/src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs b/src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs index 69bb3579720..ade18a71259 100644 --- a/src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs +++ b/src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs @@ -18,7 +18,7 @@ fn bip(v: &[uint]) -> Vec { } pub fn main() { - let mut the_vec = vec!(1u, 2, 3, 100); + let mut the_vec = vec!(1_usize, 2, 3, 100); assert_eq!(the_vec.clone(), bar(&mut the_vec)); assert_eq!(the_vec.clone(), bip(&the_vec)); } diff --git a/src/test/run-pass/coherence-where-clause.rs b/src/test/run-pass/coherence-where-clause.rs index d9c292a3e0b..9f980e161b0 100644 --- a/src/test/run-pass/coherence-where-clause.rs +++ b/src/test/run-pass/coherence-where-clause.rs @@ -39,7 +39,7 @@ where M : MyTrait + Debug + PartialEq } pub fn main() { - test_eq(0u, 0u); + test_eq(0_usize, 0_usize); let value = MyType { dummy: 256 + 22 }; test_eq(value, value); diff --git a/src/test/run-pass/concat.rs b/src/test/run-pass/concat.rs index 2a8443167d0..b0c3a5922b6 100644 --- a/src/test/run-pass/concat.rs +++ b/src/test/run-pass/concat.rs @@ -15,12 +15,12 @@ pub fn main() { assert_eq!(concat!("qux", "quux",).to_string(), "quxquux".to_string()); assert_eq!( - concat!(1, 2, 3u, 4f32, 4.0, 'a', true), + concat!(1, 2, 3_usize, 4f32, 4.0, 'a', true), "12344.0atrue" ); assert!(match "12344.0atrue" { - concat!(1, 2, 3u, 4f32, 4.0, 'a', true) => true, + concat!(1, 2, 3_usize, 4f32, 4.0, 'a', true) => true, _ => false }) } diff --git a/src/test/run-pass/const-bound.rs b/src/test/run-pass/const-bound.rs index e6a280a91d7..93a7d3e1c36 100644 --- a/src/test/run-pass/const-bound.rs +++ b/src/test/run-pass/const-bound.rs @@ -23,7 +23,7 @@ pub fn main() { foo("hi".to_string()); foo(~[1, 2, 3]); foo(F{field: 42}); - foo((1, 2u)); + foo((1, 2_usize)); foo(@1);*/ foo(box 1); } diff --git a/src/test/run-pass/crate-leading-sep.rs b/src/test/run-pass/crate-leading-sep.rs index b2956f4e229..d8b3371325b 100644 --- a/src/test/run-pass/crate-leading-sep.rs +++ b/src/test/run-pass/crate-leading-sep.rs @@ -10,5 +10,5 @@ fn main() { use ::std::mem; - mem::drop(2u); + mem::drop(2_usize); } diff --git a/src/test/run-pass/double-ref.rs b/src/test/run-pass/double-ref.rs index 656b9164dfe..8018f681f38 100644 --- a/src/test/run-pass/double-ref.rs +++ b/src/test/run-pass/double-ref.rs @@ -9,33 +9,33 @@ // except according to those terms. fn check_expr() { - let _: & uint = &1u; - let _: & & uint = &&1u; - let _: & & & uint = &&&1u; - let _: & & & uint = & &&1u; - let _: & & & & uint = &&&&1u; - let _: & & & & uint = & &&&1u; - let _: & & & & & uint = &&&&&1u; + let _: & uint = &1_usize; + let _: & & uint = &&1_usize; + let _: & & & uint = &&&1_usize; + let _: & & & uint = & &&1_usize; + let _: & & & & uint = &&&&1_usize; + let _: & & & & uint = & &&&1_usize; + let _: & & & & & uint = &&&&&1_usize; } fn check_ty() { - let _: &uint = & 1u; - let _: &&uint = & & 1u; - let _: &&&uint = & & & 1u; - let _: & &&uint = & & & 1u; - let _: &&&&uint = & & & & 1u; - let _: & &&&uint = & & & & 1u; - let _: &&&&&uint = & & & & & 1u; + let _: &uint = & 1_usize; + let _: &&uint = & & 1_usize; + let _: &&&uint = & & & 1_usize; + let _: & &&uint = & & & 1_usize; + let _: &&&&uint = & & & & 1_usize; + let _: & &&&uint = & & & & 1_usize; + let _: &&&&&uint = & & & & & 1_usize; } fn check_pat() { - let &_ = & 1u; - let &&_ = & & 1u; - let &&&_ = & & & 1u; - let & &&_ = & & & 1u; - let &&&&_ = & & & & 1u; - let & &&&_ = & & & & 1u; - let &&&&&_ = & & & & & 1u; + let &_ = & 1_usize; + let &&_ = & & 1_usize; + let &&&_ = & & & 1_usize; + let & &&_ = & & & 1_usize; + let &&&&_ = & & & & 1_usize; + let & &&&_ = & & & & 1_usize; + let &&&&&_ = & & & & & 1_usize; } pub fn main() {} diff --git a/src/test/run-pass/drop-trait-enum.rs b/src/test/run-pass/drop-trait-enum.rs index d52c645730f..b46c99ac0d9 100644 --- a/src/test/run-pass/drop-trait-enum.rs +++ b/src/test/run-pass/drop-trait-enum.rs @@ -62,7 +62,7 @@ pub fn main() { let (sender, receiver) = channel(); { - let v = Foo::NestedVariant(box 42u, SendOnDrop { sender: sender.clone() }, sender); + let v = Foo::NestedVariant(box 42_usize, SendOnDrop { sender: sender.clone() }, sender); } assert_eq!(receiver.recv().unwrap(), Message::DestructorRan); assert_eq!(receiver.recv().unwrap(), Message::Dropped); @@ -79,10 +79,10 @@ pub fn main() { let (sender, receiver) = channel(); let t = { thread::spawn(move|| { - let mut v = Foo::NestedVariant(box 42u, SendOnDrop { + let mut v = Foo::NestedVariant(box 42usize, SendOnDrop { sender: sender.clone() }, sender.clone()); - v = Foo::NestedVariant(box 42u, SendOnDrop { sender: sender.clone() }, sender.clone()); + v = Foo::NestedVariant(box 42_usize, SendOnDrop { sender: sender.clone() }, sender.clone()); v = Foo::SimpleVariant(sender.clone()); v = Foo::FailingVariant { on_drop: SendOnDrop { sender: sender } }; }) diff --git a/src/test/run-pass/extern-stress.rs b/src/test/run-pass/extern-stress.rs index 533d67e27eb..b9e08e47b37 100644 --- a/src/test/run-pass/extern-stress.rs +++ b/src/test/run-pass/extern-stress.rs @@ -41,7 +41,7 @@ fn count(n: libc::uintptr_t) -> libc::uintptr_t { } pub fn main() { - (0u..100).map(|_| { + (0_usize..100).map(|_| { Thread::scoped(move|| { assert_eq!(count(5), 16); }) diff --git a/src/test/run-pass/extern-yield.rs b/src/test/run-pass/extern-yield.rs index 5201c934185..80428d787f2 100644 --- a/src/test/run-pass/extern-yield.rs +++ b/src/test/run-pass/extern-yield.rs @@ -38,7 +38,7 @@ fn count(n: libc::uintptr_t) -> libc::uintptr_t { } pub fn main() { - (0..10u).map(|i| { + (0..10_usize).map(|i| { Thread::scoped(move|| { let result = count(5); println!("result = {}", result); diff --git a/src/test/run-pass/foreign-fn-linkname.rs b/src/test/run-pass/foreign-fn-linkname.rs index dff1a1eaa04..592ab7d0e6e 100644 --- a/src/test/run-pass/foreign-fn-linkname.rs +++ b/src/test/run-pass/foreign-fn-linkname.rs @@ -32,5 +32,5 @@ fn strlen(str: String) -> uint { pub fn main() { let len = strlen("Rust".to_string()); - assert_eq!(len, 4u); + assert_eq!(len, 4_usize); } diff --git a/src/test/run-pass/format-no-std.rs b/src/test/run-pass/format-no-std.rs index 44d80490e69..a15a176c223 100644 --- a/src/test/run-pass/format-no-std.rs +++ b/src/test/run-pass/format-no-std.rs @@ -20,13 +20,13 @@ use collections::string::ToString; #[start] fn start(_argc: int, _argv: *const *const u8) -> int { - let s = format!("{}", 1i); + let s = format!("{}", 1_isize); assert_eq!(s, "1".to_string()); let s = format!("test"); assert_eq!(s, "test".to_string()); - let s = format!("{test}", test=3i); + let s = format!("{test}", test=3_isize); assert_eq!(s, "3".to_string()); let s = format!("hello {}", "world"); diff --git a/src/test/run-pass/if-check.rs b/src/test/run-pass/if-check.rs index 660a6147d08..d2a1a3c71a5 100644 --- a/src/test/run-pass/if-check.rs +++ b/src/test/run-pass/if-check.rs @@ -9,9 +9,9 @@ // except according to those terms. fn even(x: uint) -> bool { - if x < 2u { + if x < 2_usize { return false; - } else if x == 2u { return true; } else { return even(x - 2u); } + } else if x == 2_usize { return true; } else { return even(x - 2_usize); } } fn foo(x: uint) { @@ -22,4 +22,4 @@ fn foo(x: uint) { } } -pub fn main() { foo(2u); } +pub fn main() { foo(2_usize); } diff --git a/src/test/run-pass/if-let.rs b/src/test/run-pass/if-let.rs index 06294696bc9..2d2f77b0991 100644 --- a/src/test/run-pass/if-let.rs +++ b/src/test/run-pass/if-let.rs @@ -23,14 +23,14 @@ pub fn main() { let clause: uint; if let None = Some("test") { clause = 1; - } else if 4u > 5 { + } else if 4_usize > 5 { clause = 2; } else if let Ok(()) = Err::<(),&'static str>("test") { clause = 3; } else { clause = 4; } - assert_eq!(clause, 4u); + assert_eq!(clause, 4_usize); if 3 > 4 { panic!("bad math"); @@ -57,9 +57,9 @@ pub fn main() { if false { panic!("wat"); - } else if let a@Foo::Two(_) = Foo::Two(42u) { + } else if let a@Foo::Two(_) = Foo::Two(42_usize) { if let Foo::Two(b) = a { - assert_eq!(b, 42u); + assert_eq!(b, 42_usize); } else { panic!("panic in nested if-let"); } diff --git a/src/test/run-pass/ifmt.rs b/src/test/run-pass/ifmt.rs index e5aade792ed..ab83fb90d3f 100644 --- a/src/test/run-pass/ifmt.rs +++ b/src/test/run-pass/ifmt.rs @@ -60,15 +60,15 @@ pub fn main() { t!(format!("{}", true), "true"); t!(format!("{}", '☃'), "☃"); t!(format!("{}", 10), "10"); - t!(format!("{}", 10u), "10"); + t!(format!("{}", 10_usize), "10"); t!(format!("{:?}", '☃'), "'\\u{2603}'"); t!(format!("{:?}", 10), "10"); - t!(format!("{:?}", 10u), "10"); + t!(format!("{:?}", 10_usize), "10"); t!(format!("{:?}", "true"), "\"true\""); t!(format!("{:?}", "foo\nbar"), "\"foo\\nbar\""); - t!(format!("{:o}", 10u), "12"); - t!(format!("{:x}", 10u), "a"); - t!(format!("{:X}", 10u), "A"); + t!(format!("{:o}", 10_usize), "12"); + t!(format!("{:x}", 10_usize), "a"); + t!(format!("{:X}", 10_usize), "A"); t!(format!("{}", "foo"), "foo"); t!(format!("{}", "foo".to_string()), "foo"); t!(format!("{:p}", 0x1234 as *const isize), "0x1234"); @@ -153,7 +153,7 @@ pub fn main() { // make sure that format! doesn't cause spurious unused-unsafe warnings when // it's inside of an outer unsafe block unsafe { - let a: isize = ::std::mem::transmute(3u); + let a: isize = ::std::mem::transmute(3_usize); format!("{}", a); } diff --git a/src/test/run-pass/integer-literal-radix.rs b/src/test/run-pass/integer-literal-radix.rs index b1a92f70449..ea8825d22df 100644 --- a/src/test/run-pass/integer-literal-radix.rs +++ b/src/test/run-pass/integer-literal-radix.rs @@ -9,12 +9,12 @@ // except according to those terms. pub fn main() { - let a = 0xBEEFi; - let b = 0o755i; - let c = 0b10101i; - let d = -0xBEEFi; - let e = -0o755i; - let f = -0b10101i; + let a = 0xBEEF_isize; + let b = 0o755_isize; + let c = 0b10101_isize; + let d = -0xBEEF_isize; + let e = -0o755_isize; + let f = -0b10101_isize; assert_eq!(a, 48879); assert_eq!(b, 493); diff --git a/src/test/run-pass/intrinsic-alignment.rs b/src/test/run-pass/intrinsic-alignment.rs index bd2f73440ca..f852bac4048 100644 --- a/src/test/run-pass/intrinsic-alignment.rs +++ b/src/test/run-pass/intrinsic-alignment.rs @@ -27,8 +27,8 @@ mod m { #[cfg(target_arch = "x86")] pub fn main() { unsafe { - assert_eq!(::rusti::pref_align_of::(), 8u); - assert_eq!(::rusti::min_align_of::(), 4u); + assert_eq!(::rusti::pref_align_of::(), 8_usize); + assert_eq!(::rusti::min_align_of::(), 4_usize); } } @@ -36,8 +36,8 @@ mod m { #[cfg(any(target_arch = "x86_64", target_arch = "arm", target_arch = "aarch64"))] pub fn main() { unsafe { - assert_eq!(::rusti::pref_align_of::(), 8u); - assert_eq!(::rusti::min_align_of::(), 8u); + assert_eq!(::rusti::pref_align_of::(), 8_usize); + assert_eq!(::rusti::min_align_of::(), 8_usize); } } } @@ -48,8 +48,8 @@ mod m { #[cfg(target_arch = "x86")] pub fn main() { unsafe { - assert_eq!(::rusti::pref_align_of::(), 8u); - assert_eq!(::rusti::min_align_of::(), 8u); + assert_eq!(::rusti::pref_align_of::(), 8_usize); + assert_eq!(::rusti::min_align_of::(), 8_usize); } } @@ -57,8 +57,8 @@ mod m { #[cfg(target_arch = "x86_64")] pub fn main() { unsafe { - assert_eq!(::rusti::pref_align_of::(), 8u); - assert_eq!(::rusti::min_align_of::(), 8u); + assert_eq!(::rusti::pref_align_of::(), 8_usize); + assert_eq!(::rusti::min_align_of::(), 8_usize); } } } @@ -69,8 +69,8 @@ mod m { #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] pub fn main() { unsafe { - assert_eq!(::rusti::pref_align_of::(), 8u); - assert_eq!(::rusti::min_align_of::(), 8u); + assert_eq!(::rusti::pref_align_of::(), 8_usize); + assert_eq!(::rusti::min_align_of::(), 8_usize); } } } diff --git a/src/test/run-pass/issue-11736.rs b/src/test/run-pass/issue-11736.rs index e75d118f36d..d9bae6886fa 100644 --- a/src/test/run-pass/issue-11736.rs +++ b/src/test/run-pass/issue-11736.rs @@ -15,7 +15,7 @@ use std::num::Float; fn main() { // Generate sieve of Eratosthenes for n up to 1e6 - let n = 1000000u; + let n = 1000000_usize; let mut sieve = Bitv::from_elem(n+1, true); let limit: uint = (n as f32).sqrt() as uint; for i in 2..limit+1 { diff --git a/src/test/run-pass/issue-12909.rs b/src/test/run-pass/issue-12909.rs index 3075bae44fe..b7dc98b92e0 100644 --- a/src/test/run-pass/issue-12909.rs +++ b/src/test/run-pass/issue-12909.rs @@ -15,7 +15,7 @@ fn copy(&x: &T) -> T { } fn main() { - let arr = [(1, 1u), (2, 2), (3, 3)]; + let arr = [(1, 1_usize), (2, 2), (3, 3)]; let v1: Vec<&_> = arr.iter().collect(); let v2: Vec<_> = arr.iter().map(copy).collect(); diff --git a/src/test/run-pass/issue-13352.rs b/src/test/run-pass/issue-13352.rs index 46a81301dc3..a8343712034 100644 --- a/src/test/run-pass/issue-13352.rs +++ b/src/test/run-pass/issue-13352.rs @@ -18,5 +18,5 @@ fn main() { foo(loop { unsafe { libc::exit(0 as libc::c_int); } }); - 2u + (loop {}); + 2_usize + (loop {}); } diff --git a/src/test/run-pass/issue-14393.rs b/src/test/run-pass/issue-14393.rs index e97021b4869..6c9c7e2fd3f 100644 --- a/src/test/run-pass/issue-14393.rs +++ b/src/test/run-pass/issue-14393.rs @@ -9,8 +9,8 @@ // except according to those terms. fn main() { - match ("", 1u) { - (_, 42u) => (), + match ("", 1_usize) { + (_, 42_usize) => (), ("", _) => (), _ => () } diff --git a/src/test/run-pass/issue-15189.rs b/src/test/run-pass/issue-15189.rs index 6d1813f8aa4..24340ac3f13 100644 --- a/src/test/run-pass/issue-15189.rs +++ b/src/test/run-pass/issue-15189.rs @@ -15,7 +15,7 @@ macro_rules! third { } fn main() { - let x = vec!(10u,11u,12u,13u); + let x = vec!(10_usize,11_usize,12_usize,13_usize); let t = third!(x); - assert_eq!(t,12u); + assert_eq!(t,12_usize); } diff --git a/src/test/run-pass/issue-15673.rs b/src/test/run-pass/issue-15673.rs index 7dfde2f6bad..a6b8a04eeb6 100644 --- a/src/test/run-pass/issue-15673.rs +++ b/src/test/run-pass/issue-15673.rs @@ -11,5 +11,5 @@ use std::iter::AdditiveIterator; fn main() { let x: [u64; 3] = [1, 2, 3]; - assert_eq!(6, (0us..3).map(|i| x[i]).sum()); + assert_eq!(6, (0_usize..3).map(|i| x[i]).sum()); } diff --git a/src/test/run-pass/issue-15734.rs b/src/test/run-pass/issue-15734.rs index e404f5fa118..e66ac8ff53c 100644 --- a/src/test/run-pass/issue-15734.rs +++ b/src/test/run-pass/issue-15734.rs @@ -53,12 +53,12 @@ impl> Index for Row { } fn main() { - let m = Mat::new(vec!(1u, 2, 3, 4, 5, 6), 3); + let m = Mat::new(vec!(1_usize, 2, 3, 4, 5, 6), 3); let r = m.row(1); assert!(r.index(&2) == &6); assert!(r[2] == 6); - assert!(r[2u] == 6u); + assert!(r[2_usize] == 6_usize); assert!(6 == r[2]); let e = r[2]; diff --git a/src/test/run-pass/issue-15881-model-lexer-dotdotdot.rs b/src/test/run-pass/issue-15881-model-lexer-dotdotdot.rs index d2f4bac05e9..18e1918aea4 100644 --- a/src/test/run-pass/issue-15881-model-lexer-dotdotdot.rs +++ b/src/test/run-pass/issue-15881-model-lexer-dotdotdot.rs @@ -11,24 +11,24 @@ // regression test for the model lexer handling the DOTDOTDOT syntax (#15877) pub fn main() { - match 5u { - 1u...5u => {} + match 5_usize { + 1_usize...5_usize => {} _ => panic!("should match range"), } - match 5u { - 6u...7u => panic!("shouldn't match range"), + match 5_usize { + 6_usize...7_usize => panic!("shouldn't match range"), _ => {} } - match 5u { - 1u => panic!("should match non-first range"), - 2u...6u => {} + match 5_usize { + 1_usize => panic!("should match non-first range"), + 2_usize...6_usize => {} _ => panic!("math is broken") } match 'c' { 'a'...'z' => {} _ => panic!("should suppport char ranges") } - match -3i { + match -3_isize { -7...5 => {} _ => panic!("should match signed range") } diff --git a/src/test/run-pass/issue-17662.rs b/src/test/run-pass/issue-17662.rs index 34bcfeb10de..45e70f59f33 100644 --- a/src/test/run-pass/issue-17662.rs +++ b/src/test/run-pass/issue-17662.rs @@ -15,7 +15,7 @@ extern crate "issue-17662" as i; struct Bar<'a>; impl<'a> i::Foo<'a, uint> for Bar<'a> { - fn foo(&self) -> uint { 5u } + fn foo(&self) -> uint { 5_usize } } pub fn main() { diff --git a/src/test/run-pass/issue-17877.rs b/src/test/run-pass/issue-17877.rs index 827e6a10abd..a7d9e6a4be6 100644 --- a/src/test/run-pass/issue-17877.rs +++ b/src/test/run-pass/issue-17877.rs @@ -10,12 +10,12 @@ fn main() { assert_eq!(match [0u8; 1024] { - _ => 42u, - }, 42u); + _ => 42_usize, + }, 42_usize); assert_eq!(match [0u8; 1024] { - [1, _..] => 0u, - [0, _..] => 1u, - _ => 2u - }, 1u); + [1, _..] => 0_usize, + [0, _..] => 1_usize, + _ => 2_usize + }, 1_usize); } diff --git a/src/test/run-pass/issue-18425.rs b/src/test/run-pass/issue-18425.rs index 6d223923ac1..ec7481ead04 100644 --- a/src/test/run-pass/issue-18425.rs +++ b/src/test/run-pass/issue-18425.rs @@ -15,5 +15,5 @@ #![feature(box_syntax)] fn main() { - let _ = [box 1u; 1]; + let _ = [box 1_usize; 1]; } diff --git a/src/test/run-pass/issue-18539.rs b/src/test/run-pass/issue-18539.rs index f724af73422..ce56f3e8d72 100644 --- a/src/test/run-pass/issue-18539.rs +++ b/src/test/run-pass/issue-18539.rs @@ -19,5 +19,5 @@ fn uint_to_foo(_: uint) -> Foo { #[allow(unused_must_use)] fn main() { - (0u..10).map(uint_to_foo); + (0_usize..10).map(uint_to_foo); } diff --git a/src/test/run-pass/issue-18767.rs b/src/test/run-pass/issue-18767.rs index 6ba5906708c..2f23b8028ec 100644 --- a/src/test/run-pass/issue-18767.rs +++ b/src/test/run-pass/issue-18767.rs @@ -12,7 +12,7 @@ // and doesn't ICE. fn main() { - for &&x in Some(&0u).iter() { + for &&x in Some(&0_usize).iter() { assert_eq!(x, 0) } } diff --git a/src/test/run-pass/issue-19499.rs b/src/test/run-pass/issue-19499.rs index 04017da9775..0578db8f854 100644 --- a/src/test/run-pass/issue-19499.rs +++ b/src/test/run-pass/issue-19499.rs @@ -16,5 +16,5 @@ fn main() { let n = 0; - let it = Some(1_us).into_iter().inspect(|_| {n;}); + let it = Some(1_usize).into_iter().inspect(|_| {n;}); } diff --git a/src/test/run-pass/issue-2185.rs b/src/test/run-pass/issue-2185.rs index 2543c02d4a1..20ff8d29b70 100644 --- a/src/test/run-pass/issue-2185.rs +++ b/src/test/run-pass/issue-2185.rs @@ -72,17 +72,17 @@ fn range(lo: uint, hi: uint, it: |uint|) { let mut i = lo; while i < hi { it(i); - i += 1u; + i += 1_usize; } } pub fn main() { - let range: 'static ||uint|| = |a| range(0u, 1000u, a); + let range: 'static ||uint|| = |a| range(0_usize, 1000_usize, a); let filt: 'static ||v: uint|| = |a| filter( range, - |&&n: uint| n % 3u != 0u && n % 5u != 0u, + |&&n: uint| n % 3_usize != 0_usize && n % 5_usize != 0_usize, a); - let sum = foldl(filt, 0u, |accum, &&n: uint| accum + n ); + let sum = foldl(filt, 0_usize, |accum, &&n: uint| accum + n ); println!("{}", sum); } diff --git a/src/test/run-pass/issue-2550.rs b/src/test/run-pass/issue-2550.rs index 99c68826502..395b2c4b459 100644 --- a/src/test/run-pass/issue-2550.rs +++ b/src/test/run-pass/issue-2550.rs @@ -22,5 +22,5 @@ fn f(_x: T) { } pub fn main() { - f(C(1u)); + f(C(1_usize)); } diff --git a/src/test/run-pass/issue-2989.rs b/src/test/run-pass/issue-2989.rs index e18dbf2dd87..8767d397b64 100644 --- a/src/test/run-pass/issue-2989.rs +++ b/src/test/run-pass/issue-2989.rs @@ -21,7 +21,7 @@ impl methods for () { // the position of this function is significant! - if it comes before methods // then it works, if it comes after it then it doesn't! fn to_bools(bitv: Storage) -> Vec { - (0us..8).map(|i| { + (0_usize..8).map(|i| { let w = i / 64; let b = i % 64; let x = 1u64 & (bitv.storage[w] >> b); @@ -35,7 +35,7 @@ pub fn main() { let bools = vec!(false, false, true, false, false, true, true, false); let bools2 = to_bools(Storage{storage: vec!(0b01100100)}); - for i in 0u..8 { + for i in 0_usize..8 { println!("{} => {} vs {}", i, bools[i], bools2[i]); } diff --git a/src/test/run-pass/issue-3429.rs b/src/test/run-pass/issue-3429.rs index 6fc8c9c6843..e331a1a2d0c 100644 --- a/src/test/run-pass/issue-3429.rs +++ b/src/test/run-pass/issue-3429.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let x = 1u; + let x = 1_usize; let y = || x; let _z = y(); } diff --git a/src/test/run-pass/issue-3609.rs b/src/test/run-pass/issue-3609.rs index 6ffc12b943c..4a28c34e5d9 100644 --- a/src/test/run-pass/issue-3609.rs +++ b/src/test/run-pass/issue-3609.rs @@ -29,7 +29,7 @@ fn foo(name: String, samples_chan: Sender) { // `box() (...)` syntax is needed to make pretty printer converge in one try: let callback: SamplesFn = box() (move |buffer| { - for i in 0u..buffer.len() { + for i in 0_usize..buffer.len() { println!("{}: {}", i, buffer[i]) } }); diff --git a/src/test/run-pass/issue-6130.rs b/src/test/run-pass/issue-6130.rs index f28a85eab3e..93429ff10dc 100644 --- a/src/test/run-pass/issue-6130.rs +++ b/src/test/run-pass/issue-6130.rs @@ -12,9 +12,9 @@ pub fn main() { let i: uint = 0; - assert!(i <= 0xFFFF_FFFF_u); + assert!(i <= 0xFFFF_FFFF_usize); let i: int = 0; - assert!(i >= -0x8000_0000_i); - assert!(i <= 0x7FFF_FFFF_i); + assert!(i >= -0x8000_0000__isize); + assert!(i <= 0x7FFF_FFFF__isize); } diff --git a/src/test/run-pass/issue-6892.rs b/src/test/run-pass/issue-6892.rs index c2e0f5206ae..557ec82233d 100644 --- a/src/test/run-pass/issue-6892.rs +++ b/src/test/run-pass/issue-6892.rs @@ -49,7 +49,7 @@ fn main() { assert_eq!(unsafe { NUM_DROPS }, 3); { let _x = FooBar::_Foo(Foo); } assert_eq!(unsafe { NUM_DROPS }, 5); - { let _x = FooBar::_Bar(42u); } + { let _x = FooBar::_Bar(42_usize); } assert_eq!(unsafe { NUM_DROPS }, 6); { let _ = Foo; } @@ -60,6 +60,6 @@ fn main() { assert_eq!(unsafe { NUM_DROPS }, 9); { let _ = FooBar::_Foo(Foo); } assert_eq!(unsafe { NUM_DROPS }, 11); - { let _ = FooBar::_Bar(42u); } + { let _ = FooBar::_Bar(42_usize); } assert_eq!(unsafe { NUM_DROPS }, 12); } diff --git a/src/test/run-pass/issue-8460.rs b/src/test/run-pass/issue-8460.rs index 72a1ec436f3..00339a4e84b 100644 --- a/src/test/run-pass/issue-8460.rs +++ b/src/test/run-pass/issue-8460.rs @@ -21,7 +21,7 @@ fn main() { assert!(thread::spawn(move|| { min_val::() / -1; }).join().is_err()); assert!(thread::spawn(move|| { min_val::() / -1; }).join().is_err()); assert!(thread::spawn(move|| { min_val::() / -1; }).join().is_err()); - assert!(thread::spawn(move|| { 1is / zero(); }).join().is_err()); + assert!(thread::spawn(move|| { 1isize / zero(); }).join().is_err()); assert!(thread::spawn(move|| { 1i8 / zero(); }).join().is_err()); assert!(thread::spawn(move|| { 1i16 / zero(); }).join().is_err()); assert!(thread::spawn(move|| { 1i32 / zero(); }).join().is_err()); @@ -31,7 +31,7 @@ fn main() { assert!(thread::spawn(move|| { min_val::() % -1; }).join().is_err()); assert!(thread::spawn(move|| { min_val::() % -1; }).join().is_err()); assert!(thread::spawn(move|| { min_val::() % -1; }).join().is_err()); - assert!(thread::spawn(move|| { 1is % zero(); }).join().is_err()); + assert!(thread::spawn(move|| { 1isize % zero(); }).join().is_err()); assert!(thread::spawn(move|| { 1i8 % zero(); }).join().is_err()); assert!(thread::spawn(move|| { 1i16 % zero(); }).join().is_err()); assert!(thread::spawn(move|| { 1i32 % zero(); }).join().is_err()); diff --git a/src/test/run-pass/issue-8783.rs b/src/test/run-pass/issue-8783.rs index d59c0ad52e9..815e00e1291 100644 --- a/src/test/run-pass/issue-8783.rs +++ b/src/test/run-pass/issue-8783.rs @@ -13,7 +13,7 @@ use std::default::Default; struct X { pub x: uint } impl Default for X { fn default() -> X { - X { x: 42u } + X { x: 42_usize } } } diff --git a/src/test/run-pass/item-attributes.rs b/src/test/run-pass/item-attributes.rs index 2aa5a579666..6036af5c627 100644 --- a/src/test/run-pass/item-attributes.rs +++ b/src/test/run-pass/item-attributes.rs @@ -175,7 +175,7 @@ mod test_foreign_items { #![str = "s"] #![char = 'c'] #![int = 100] - #![uint = 100u] + #![uint = 100_usize] #![mach_int = 100u32] #![float = 1.0] #![mach_float = 1.0f32] diff --git a/src/test/run-pass/last-use-in-cap-clause.rs b/src/test/run-pass/last-use-in-cap-clause.rs index 4231e5dba9f..566d34e6d86 100644 --- a/src/test/run-pass/last-use-in-cap-clause.rs +++ b/src/test/run-pass/last-use-in-cap-clause.rs @@ -19,8 +19,8 @@ struct A { a: Box } fn foo() -> Box isize + 'static> { let k = box 22; let _u = A {a: k.clone()}; - // FIXME(#16640) suffix in `22i` suffix shouldn't be necessary - let result = || 22i; + // FIXME(#16640) suffix in `22_isize` suffix shouldn't be necessary + let result = || 22_isize; box result } diff --git a/src/test/run-pass/let-destruct-ref.rs b/src/test/run-pass/let-destruct-ref.rs index 343780b2463..c0f674d0371 100644 --- a/src/test/run-pass/let-destruct-ref.rs +++ b/src/test/run-pass/let-destruct-ref.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let x = 3u; + let x = 3_usize; let ref y = x; assert_eq!(x, *y); } diff --git a/src/test/run-pass/loop-break-cont-1.rs b/src/test/run-pass/loop-break-cont-1.rs index 3b7e03ae58d..d58d2a71396 100644 --- a/src/test/run-pass/loop-break-cont-1.rs +++ b/src/test/run-pass/loop-break-cont-1.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - let _i = 0u; + let _i = 0_usize; loop { break; } diff --git a/src/test/run-pass/loop-break-cont.rs b/src/test/run-pass/loop-break-cont.rs index b9b16d10b8c..a15efa2d8ee 100644 --- a/src/test/run-pass/loop-break-cont.rs +++ b/src/test/run-pass/loop-break-cont.rs @@ -9,24 +9,24 @@ // except according to those terms. pub fn main() { - let mut i = 0u; + let mut i = 0_usize; loop { println!("a"); - i += 1u; - if i == 10u { + i += 1_usize; + if i == 10_usize { break; } } - assert_eq!(i, 10u); + assert_eq!(i, 10_usize); let mut is_even = false; loop { - if i == 21u { + if i == 21_usize { break; } println!("b"); is_even = false; - i += 1u; - if i % 2u != 0u { + i += 1_usize; + if i % 2_usize != 0_usize { continue; } is_even = true; @@ -34,12 +34,12 @@ pub fn main() { assert!(!is_even); loop { println!("c"); - if i == 22u { + if i == 22_usize { break; } is_even = false; - i += 1u; - if i % 2u != 0u { + i += 1_usize; + if i % 2_usize != 0_usize { continue; } is_even = true; diff --git a/src/test/run-pass/macro-delimiter-significance.rs b/src/test/run-pass/macro-delimiter-significance.rs index fcf2dff66a5..01362f0f83f 100644 --- a/src/test/run-pass/macro-delimiter-significance.rs +++ b/src/test/run-pass/macro-delimiter-significance.rs @@ -9,6 +9,6 @@ // except according to those terms. fn main() { - vec![1u, 2, 3].len(); + vec![1_usize, 2, 3].len(); } diff --git a/src/test/run-pass/macro-include-items.rs b/src/test/run-pass/macro-include-items.rs index 5c95f67257c..9e2f431c3ec 100644 --- a/src/test/run-pass/macro-include-items.rs +++ b/src/test/run-pass/macro-include-items.rs @@ -16,5 +16,5 @@ include!(concat!("", "", "../auxiliary/", "macro-include-items-item.rs")); fn main() { foo(); - assert_eq!(include!(concat!("", "../auxiliary/", "macro-include-items-expr.rs")), 1u); + assert_eq!(include!(concat!("", "../auxiliary/", "macro-include-items-expr.rs")), 1_usize); } diff --git a/src/test/run-pass/macro-interpolation.rs b/src/test/run-pass/macro-interpolation.rs index ff5b29d6ac8..069aeb9220e 100644 --- a/src/test/run-pass/macro-interpolation.rs +++ b/src/test/run-pass/macro-interpolation.rs @@ -24,6 +24,6 @@ macro_rules! overly_complicated { pub fn main() { assert!(overly_complicated!(f, x, Option, { return Some(x); }, - Some(8u), Some(y), y) == 8u) + Some(8_usize), Some(y), y) == 8_usize) } diff --git a/src/test/run-pass/macro-of-higher-order.rs b/src/test/run-pass/macro-of-higher-order.rs index 3276aa0265f..1a77eee824b 100644 --- a/src/test/run-pass/macro-of-higher-order.rs +++ b/src/test/run-pass/macro-of-higher-order.rs @@ -11,7 +11,7 @@ macro_rules! higher_order { (subst $lhs:tt => $rhs:tt) => ({ macro_rules! anon { $lhs => $rhs } - anon!(1u, 2u, "foo") + anon!(1_usize, 2_usize, "foo") }); } diff --git a/src/test/run-pass/macro-pat.rs b/src/test/run-pass/macro-pat.rs index 30a74126b49..6f2626a5af5 100644 --- a/src/test/run-pass/macro-pat.rs +++ b/src/test/run-pass/macro-pat.rs @@ -47,9 +47,9 @@ fn f(c: Option) -> uint { } pub fn main() { - assert_eq!(1u, f(Some('x'))); - assert_eq!(2u, f(Some('y'))); - assert_eq!(3u, f(None)); + assert_eq!(1_usize, f(Some('x'))); + assert_eq!(2_usize, f(Some('y'))); + assert_eq!(3_usize, f(None)); assert_eq!(1, match Some('x') { Some(char_x!()) => 1, diff --git a/src/test/run-pass/macro-reexport-no-intermediate-use.rs b/src/test/run-pass/macro-reexport-no-intermediate-use.rs index 77ef9421273..dba623876b0 100644 --- a/src/test/run-pass/macro-reexport-no-intermediate-use.rs +++ b/src/test/run-pass/macro-reexport-no-intermediate-use.rs @@ -16,5 +16,5 @@ extern crate macro_reexport_2_no_use; fn main() { - assert_eq!(reexported!(), 3u); + assert_eq!(reexported!(), 3_usize); } diff --git a/src/test/run-pass/macro-reexport.rs b/src/test/run-pass/macro-reexport.rs index 9701610cbd9..a6af8c45c24 100644 --- a/src/test/run-pass/macro-reexport.rs +++ b/src/test/run-pass/macro-reexport.rs @@ -16,5 +16,5 @@ extern crate macro_reexport_2; fn main() { - assert_eq!(reexported!(), 3u); + assert_eq!(reexported!(), 3_usize); } diff --git a/src/test/run-pass/match-range.rs b/src/test/run-pass/match-range.rs index b9ab0c85ec4..68719090cff 100644 --- a/src/test/run-pass/match-range.rs +++ b/src/test/run-pass/match-range.rs @@ -11,17 +11,17 @@ // ignore-lexer-test FIXME #15877 pub fn main() { - match 5u { - 1u...5u => {} + match 5_usize { + 1_usize...5_usize => {} _ => panic!("should match range"), } - match 5u { - 6u...7u => panic!("shouldn't match range"), + match 5_usize { + 6_usize...7_usize => panic!("shouldn't match range"), _ => {} } - match 5u { - 1u => panic!("should match non-first range"), - 2u...6u => {} + match 5_usize { + 1_usize => panic!("should match non-first range"), + 2_usize...6_usize => {} _ => panic!("math is broken") } match 'c' { diff --git a/src/test/run-pass/match-vec-alternatives.rs b/src/test/run-pass/match-vec-alternatives.rs index 98b9d11ecdd..eb6b2176e51 100644 --- a/src/test/run-pass/match-vec-alternatives.rs +++ b/src/test/run-pass/match-vec-alternatives.rs @@ -70,7 +70,7 @@ fn main() { assert_eq!(match_vecs_snoc::(&[], &[]), "both empty"); assert_eq!(match_vecs_snoc(&[1, 2, 3], &[]), "one empty"); - assert_eq!(match_nested_vecs_cons(None, Ok::<&[_], ()>(&[4u, 2u])), + assert_eq!(match_nested_vecs_cons(None, Ok::<&[_], ()>(&[4_usize, 2_usize])), "None, Ok(at least two elements)"); assert_eq!(match_nested_vecs_cons::(None, Err(())), "None, Ok(less than one element)"); assert_eq!(match_nested_vecs_cons::(Some::<&[_]>(&[]), Ok::<&[_], ()>(&[])), @@ -79,7 +79,7 @@ fn main() { assert_eq!(match_nested_vecs_cons(Some::<&[_]>(&[(42, ())]), Ok::<&[_], ()>(&[(1, ())])), "Some(non-empty), any"); - assert_eq!(match_nested_vecs_snoc(None, Ok::<&[_], ()>(&[4u, 2u])), + assert_eq!(match_nested_vecs_snoc(None, Ok::<&[_], ()>(&[4_usize, 2_usize])), "None, Ok(at least two elements)"); assert_eq!(match_nested_vecs_snoc::(None, Err(())), "None, Ok(less than one element)"); assert_eq!(match_nested_vecs_snoc::(Some::<&[_]>(&[]), Ok::<&[_], ()>(&[])), diff --git a/src/test/run-pass/method-self-arg.rs b/src/test/run-pass/method-self-arg.rs index 2225ccdc516..de24297c7b5 100644 --- a/src/test/run-pass/method-self-arg.rs +++ b/src/test/run-pass/method-self-arg.rs @@ -54,5 +54,5 @@ fn main() { x.foo(&x); - unsafe { assert!(COUNT == 2u*3*3*3*5*5*5*7*7*7); } + unsafe { assert!(COUNT == 2_usize*3*3*3*5*5*5*7*7*7); } } diff --git a/src/test/run-pass/method-two-trait-defer-resolution-2.rs b/src/test/run-pass/method-two-trait-defer-resolution-2.rs index 7f498b2b578..7463783be59 100644 --- a/src/test/run-pass/method-two-trait-defer-resolution-2.rs +++ b/src/test/run-pass/method-two-trait-defer-resolution-2.rs @@ -34,7 +34,7 @@ impl Foo for Vec> { fn call_foo_copy() -> int { let mut x = Vec::new(); let y = x.foo(); - x.push(0u); + x.push(0_usize); y } diff --git a/src/test/run-pass/move-3-unique.rs b/src/test/run-pass/move-3-unique.rs index 42959f82972..07d0594b494 100644 --- a/src/test/run-pass/move-3-unique.rs +++ b/src/test/run-pass/move-3-unique.rs @@ -27,7 +27,7 @@ fn test(x: bool, foo: Box) -> int { pub fn main() { let x = box Triple{x: 1, y: 2, z: 3}; - for _ in 0u..10000u { + for _ in 0_usize..10000_usize { assert_eq!(test(true, x.clone()), 2); } assert_eq!(test(false, x), 5); diff --git a/src/test/run-pass/multidispatch2.rs b/src/test/run-pass/multidispatch2.rs index ecacc7f1df9..6b52ea9dfa7 100644 --- a/src/test/run-pass/multidispatch2.rs +++ b/src/test/run-pass/multidispatch2.rs @@ -40,7 +40,7 @@ where T : Eq + Debug, } pub fn main() { - test_eq(22u, 0u); + test_eq(22_usize, 0_usize); let value = MyType { dummy: 256 + 22 }; test_eq(value, value.dummy); diff --git a/src/test/run-pass/numeric-method-autoexport.rs b/src/test/run-pass/numeric-method-autoexport.rs index c414d735f7c..eccc2a41a8d 100644 --- a/src/test/run-pass/numeric-method-autoexport.rs +++ b/src/test/run-pass/numeric-method-autoexport.rs @@ -29,7 +29,7 @@ pub fn main() { // uints // num - assert_eq!(15_usize.add(6us), 21_usize); + assert_eq!(15_usize.add(6_usize), 21_usize); assert_eq!(15_u8.add(6u8), 21_u8); assert_eq!(15_u16.add(6u16), 21_u16); assert_eq!(15_u32.add(6u32), 21_u32); diff --git a/src/test/run-pass/objects-coerce-freeze-borrored.rs b/src/test/run-pass/objects-coerce-freeze-borrored.rs index 0bdc36750ae..998af27c338 100644 --- a/src/test/run-pass/objects-coerce-freeze-borrored.rs +++ b/src/test/run-pass/objects-coerce-freeze-borrored.rs @@ -40,9 +40,9 @@ fn do_it_imm(obj: &Foo, v: uint) { } pub fn main() { - let mut x = 22_u; + let mut x = 22_usize; let obj = &mut x as &mut Foo; do_it_mut(obj); - do_it_imm(obj, 23u); + do_it_imm(obj, 23_usize); do_it_mut(obj); } diff --git a/src/test/run-pass/objects-owned-object-borrowed-method-headerless.rs b/src/test/run-pass/objects-owned-object-borrowed-method-headerless.rs index ce807500138..30a8c270bd7 100644 --- a/src/test/run-pass/objects-owned-object-borrowed-method-headerless.rs +++ b/src/test/run-pass/objects-owned-object-borrowed-method-headerless.rs @@ -37,7 +37,7 @@ pub fn main() { box BarStruct{ x: 2 } as Box ); - for i in 0u..foos.len() { + for i in 0_usize..foos.len() { assert_eq!(i, foos[i].foo()); } } diff --git a/src/test/run-pass/or-pattern.rs b/src/test/run-pass/or-pattern.rs index 1a42c3ca594..654d2429a0b 100644 --- a/src/test/run-pass/or-pattern.rs +++ b/src/test/run-pass/or-pattern.rs @@ -16,6 +16,6 @@ fn or_alt(q: blah) -> int { pub fn main() { assert_eq!(or_alt(blah::c), 0); - assert_eq!(or_alt(blah::a(10, 100, 0u)), 110); + assert_eq!(or_alt(blah::a(10, 100, 0_usize)), 110); assert_eq!(or_alt(blah::b(20, 200)), 220); } diff --git a/src/test/run-pass/over-constrained-vregs.rs b/src/test/run-pass/over-constrained-vregs.rs index 4cd8e65e500..1118638fe07 100644 --- a/src/test/run-pass/over-constrained-vregs.rs +++ b/src/test/run-pass/over-constrained-vregs.rs @@ -10,10 +10,10 @@ // Regression test for issue #152. pub fn main() { - let mut b: uint = 1u; - while b <= 32u { - 0u << b; - b <<= 1u; + let mut b: uint = 1_usize; + while b <= 32_usize { + 0_usize << b; + b <<= 1_usize; println!("{}", b); } } diff --git a/src/test/run-pass/overloaded-autoderef.rs b/src/test/run-pass/overloaded-autoderef.rs index faa79f71d9e..f40c9dc45ca 100644 --- a/src/test/run-pass/overloaded-autoderef.rs +++ b/src/test/run-pass/overloaded-autoderef.rs @@ -22,8 +22,8 @@ struct Point { } pub fn main() { - let box_5 = box 5u; - assert_eq!(Rc::new(5u).to_uint(), Some(5)); + let box_5 = box 5_usize; + assert_eq!(Rc::new(5_usize).to_uint(), Some(5)); assert_eq!((box &box &Rc::new(box box &box_5)).to_uint(), Some(5)); let point = Rc::new(Point {x: 2, y: 4}); assert_eq!(point.x, 2); diff --git a/src/test/run-pass/packed-struct-vec.rs b/src/test/run-pass/packed-struct-vec.rs index ede94acd934..cfe49c38c52 100644 --- a/src/test/run-pass/packed-struct-vec.rs +++ b/src/test/run-pass/packed-struct-vec.rs @@ -24,7 +24,7 @@ pub fn main() { assert_eq!(mem::size_of::<[Foo; 10]>(), 90); - for i in 0u..10 { + for i in 0_usize..10 { assert_eq!(foos[i], Foo { bar: 1, baz: 2}); } diff --git a/src/test/run-pass/path.rs b/src/test/run-pass/path.rs index 44953c44da3..02d8602d59e 100644 --- a/src/test/run-pass/path.rs +++ b/src/test/run-pass/path.rs @@ -14,4 +14,4 @@ mod foo { pub fn bar(_offset: uint) { } } -pub fn main() { foo::bar(0u); } +pub fn main() { foo::bar(0_usize); } diff --git a/src/test/run-pass/pattern-bound-var-in-for-each.rs b/src/test/run-pass/pattern-bound-var-in-for-each.rs index 28a1a8dba9e..7d9c3d324f0 100644 --- a/src/test/run-pass/pattern-bound-var-in-for-each.rs +++ b/src/test/run-pass/pattern-bound-var-in-for-each.rs @@ -16,13 +16,13 @@ fn foo(src: uint) { match Some(src) { Some(src_id) => { - for _i in 0u..10u { + for _i in 0_usize..10_usize { let yyy = src_id; - assert_eq!(yyy, 0u); + assert_eq!(yyy, 0_usize); } } _ => { } } } -pub fn main() { foo(0u); } +pub fn main() { foo(0_usize); } diff --git a/src/test/run-pass/placement-new-arena.rs b/src/test/run-pass/placement-new-arena.rs index 1ca7e5aa3c4..7ad93d271a9 100644 --- a/src/test/run-pass/placement-new-arena.rs +++ b/src/test/run-pass/placement-new-arena.rs @@ -15,7 +15,7 @@ use arena::Arena; pub fn main() { let mut arena = Arena::new(); let p = &mut arena; - let x = p.alloc(|| 4u); + let x = p.alloc(|| 4_usize); println!("{}", *x); - assert_eq!(*x, 4u); + assert_eq!(*x, 4_usize); } diff --git a/src/test/run-pass/private-class-field.rs b/src/test/run-pass/private-class-field.rs index 93872bebec9..c7380b362fb 100644 --- a/src/test/run-pass/private-class-field.rs +++ b/src/test/run-pass/private-class-field.rs @@ -26,6 +26,6 @@ fn cat(in_x : uint, in_y : int) -> cat { } pub fn main() { - let mut nyan : cat = cat(52u, 99); - assert_eq!(nyan.meow_count(), 52u); + let mut nyan : cat = cat(52_usize, 99); + assert_eq!(nyan.meow_count(), 52_usize); } diff --git a/src/test/run-pass/private-method.rs b/src/test/run-pass/private-method.rs index 03566281bc4..498bd04e37c 100644 --- a/src/test/run-pass/private-method.rs +++ b/src/test/run-pass/private-method.rs @@ -16,13 +16,13 @@ struct cat { impl cat { pub fn play(&mut self) { - self.meows += 1u; + self.meows += 1_usize; self.nap(); } } impl cat { - fn nap(&mut self) { for _ in 1u..10u { } } + fn nap(&mut self) { for _ in 1_usize..10_usize { } } } fn cat(in_x : uint, in_y : int) -> cat { @@ -33,6 +33,6 @@ fn cat(in_x : uint, in_y : int) -> cat { } pub fn main() { - let mut nyan : cat = cat(52u, 99); + let mut nyan : cat = cat(52_usize, 99); nyan.play(); } diff --git a/src/test/run-pass/pub-extern-privacy.rs b/src/test/run-pass/pub-extern-privacy.rs index 16f5a06b886..7428377b59f 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(0u)); + a::free(transmute(0_usize)); } } diff --git a/src/test/run-pass/pure-sum.rs b/src/test/run-pass/pure-sum.rs index 7fbdd2f219e..f7adb0f6e44 100644 --- a/src/test/run-pass/pure-sum.rs +++ b/src/test/run-pass/pure-sum.rs @@ -14,31 +14,31 @@ #![feature(box_syntax)] fn sums_to(v: Vec , sum: int) -> bool { - let mut i = 0u; + let mut i = 0_usize; let mut sum0 = 0; while i < v.len() { sum0 += v[i]; - i += 1u; + i += 1_usize; } return sum0 == sum; } fn sums_to_using_uniq(v: Vec , sum: int) -> bool { - let mut i = 0u; + let mut i = 0_usize; let mut sum0 = box 0; while i < v.len() { *sum0 += v[i]; - i += 1u; + i += 1_usize; } return *sum0 == sum; } fn sums_to_using_rec(v: Vec , sum: int) -> bool { - let mut i = 0u; + let mut i = 0_usize; let mut sum0 = F {f: 0}; while i < v.len() { sum0.f += v[i]; - i += 1u; + i += 1_usize; } return sum0.f == sum; } @@ -46,11 +46,11 @@ fn sums_to_using_rec(v: Vec , sum: int) -> bool { struct F { f: T } fn sums_to_using_uniq_rec(v: Vec , sum: int) -> bool { - let mut i = 0u; + let mut i = 0_usize; let mut sum0 = F {f: box 0}; while i < v.len() { *sum0.f += v[i]; - i += 1u; + i += 1_usize; } return *sum0.f == sum; } diff --git a/src/test/run-pass/range.rs b/src/test/run-pass/range.rs index 5d2337e3819..50b90b1a5ee 100644 --- a/src/test/run-pass/range.rs +++ b/src/test/run-pass/range.rs @@ -18,14 +18,14 @@ fn return_full_range() -> ::std::ops::RangeFull { return ..; } pub fn main() { let mut count = 0; - for i in 0u..10 { + for i in 0_usize..10 { assert!(i >= 0 && i < 10); count += i; } assert!(count == 45); let mut count = 0; - let mut range = 0u..10; + let mut range = 0_usize..10; for i in range { assert!(i >= 0 && i < 10); count += i; @@ -33,17 +33,17 @@ pub fn main() { assert!(count == 45); let mut count = 0; - let mut rf = 3u..; + let mut rf = 3_usize..; for i in rf.take(10) { assert!(i >= 3 && i < 13); count += i; } assert!(count == 75); - let _ = 0u..4+4-3; + let _ = 0_usize..4+4-3; let _ = 0..foo(); - let _ = ..42u; + let _ = ..42_usize; // Test we can use two different types with a common supertype. let x = &42; diff --git a/src/test/run-pass/realloc-16687.rs b/src/test/run-pass/realloc-16687.rs index 441c9d79e79..de5b14104c5 100644 --- a/src/test/run-pass/realloc-16687.rs +++ b/src/test/run-pass/realloc-16687.rs @@ -35,9 +35,9 @@ unsafe fn test_triangle() -> bool { // from pairs of rows (where each pair of rows is equally sized), // and the elements of the triangle match their row-pair index. unsafe fn sanity_check(ascend: &[*mut u8]) { - for i in 0u..COUNT / 2 { + for i in 0_usize..COUNT / 2 { let (p0, p1, size) = (ascend[2*i], ascend[2*i+1], idx_to_size(i)); - for j in 0u..size { + for j in 0_usize..size { assert_eq!(*p0.offset(j as int), i as u8); assert_eq!(*p1.offset(j as int), i as u8); } @@ -88,14 +88,14 @@ unsafe fn test_triangle() -> bool { // that at least two rows will be allocated near each other, so // that we trigger the bug (a buffer overrun) in an observable // way.) - for i in 0u..COUNT / 2 { + for i in 0_usize..COUNT / 2 { let size = idx_to_size(i); ascend[2*i] = allocate(size, ALIGN); ascend[2*i+1] = allocate(size, ALIGN); } // Initialize each pair of rows to distinct value. - for i in 0u..COUNT / 2 { + for i in 0_usize..COUNT / 2 { let (p0, p1, size) = (ascend[2*i], ascend[2*i+1], idx_to_size(i)); for j in 0..size { *p0.offset(j as int) = i as u8; @@ -109,7 +109,7 @@ unsafe fn test_triangle() -> bool { test_3(ascend); // triangle -> square test_4(ascend); // square -> triangle - for i in 0u..COUNT / 2 { + for i in 0_usize..COUNT / 2 { let size = idx_to_size(i); deallocate(ascend[2*i], size, ALIGN); deallocate(ascend[2*i+1], size, ALIGN); @@ -123,7 +123,7 @@ unsafe fn test_triangle() -> bool { // rows as we go. unsafe fn test_1(ascend: &mut [*mut u8]) { let new_size = idx_to_size(COUNT-1); - for i in 0u..COUNT / 2 { + for i in 0_usize..COUNT / 2 { let (p0, p1, old_size) = (ascend[2*i], ascend[2*i+1], idx_to_size(i)); assert!(old_size < new_size); @@ -138,7 +138,7 @@ unsafe fn test_triangle() -> bool { // Test 2: turn the square back into a triangle, top to bottom. unsafe fn test_2(ascend: &mut [*mut u8]) { let old_size = idx_to_size(COUNT-1); - for i in 0u..COUNT / 2 { + for i in 0_usize..COUNT / 2 { let (p0, p1, new_size) = (ascend[2*i], ascend[2*i+1], idx_to_size(i)); assert!(new_size < old_size); @@ -153,7 +153,7 @@ unsafe fn test_triangle() -> bool { // Test 3: turn triangle into a square, bottom to top. unsafe fn test_3(ascend: &mut [*mut u8]) { let new_size = idx_to_size(COUNT-1); - for i in (0u..COUNT / 2).rev() { + for i in (0_usize..COUNT / 2).rev() { let (p0, p1, old_size) = (ascend[2*i], ascend[2*i+1], idx_to_size(i)); assert!(old_size < new_size); @@ -168,7 +168,7 @@ unsafe fn test_triangle() -> bool { // Test 4: turn the square back into a triangle, bottom to top. unsafe fn test_4(ascend: &mut [*mut u8]) { let old_size = idx_to_size(COUNT-1); - for i in (0u..COUNT / 2).rev() { + for i in (0_usize..COUNT / 2).rev() { let (p0, p1, new_size) = (ascend[2*i], ascend[2*i+1], idx_to_size(i)); assert!(new_size < old_size); diff --git a/src/test/run-pass/rec-align-u32.rs b/src/test/run-pass/rec-align-u32.rs index 05643b0b56b..51b800bc9f0 100644 --- a/src/test/run-pass/rec-align-u32.rs +++ b/src/test/run-pass/rec-align-u32.rs @@ -38,14 +38,14 @@ struct Outer { #[cfg(any(target_arch = "x86", target_arch = "arm", target_arch = "aarch64"))] mod m { - pub fn align() -> uint { 4u } - pub fn size() -> uint { 8u } + pub fn align() -> uint { 4_usize } + pub fn size() -> uint { 8_usize } } #[cfg(target_arch = "x86_64")] mod m { - pub fn align() -> uint { 4u } - pub fn size() -> uint { 8u } + pub fn align() -> uint { 4_usize } + pub fn size() -> uint { 8_usize } } pub fn main() { diff --git a/src/test/run-pass/rec-align-u64.rs b/src/test/run-pass/rec-align-u64.rs index 0be6e22f609..cf23a1a0f25 100644 --- a/src/test/run-pass/rec-align-u64.rs +++ b/src/test/run-pass/rec-align-u64.rs @@ -44,14 +44,14 @@ struct Outer { mod m { #[cfg(target_arch = "x86")] pub mod m { - pub fn align() -> uint { 4u } - pub fn size() -> uint { 12u } + pub fn align() -> uint { 4_usize } + pub fn size() -> uint { 12_usize } } #[cfg(any(target_arch = "x86_64", target_arch = "arm", target_arch = "aarch64"))] pub mod m { - pub fn align() -> uint { 8u } - pub fn size() -> uint { 16u } + pub fn align() -> uint { 8_usize } + pub fn size() -> uint { 16_usize } } } @@ -59,14 +59,14 @@ mod m { mod m { #[cfg(target_arch = "x86")] pub mod m { - pub fn align() -> uint { 8u } - pub fn size() -> uint { 16u } + pub fn align() -> uint { 8_usize } + pub fn size() -> uint { 16_usize } } #[cfg(target_arch = "x86_64")] pub mod m { - pub fn align() -> uint { 8u } - pub fn size() -> uint { 16u } + pub fn align() -> uint { 8_usize } + pub fn size() -> uint { 16_usize } } } @@ -74,8 +74,8 @@ mod m { mod m { #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] pub mod m { - pub fn align() -> uint { 8u } - pub fn size() -> uint { 16u } + pub fn align() -> uint { 8_usize } + pub fn size() -> uint { 16_usize } } } diff --git a/src/test/run-pass/record-pat.rs b/src/test/run-pass/record-pat.rs index e0db1ed75dc..282a24a407c 100644 --- a/src/test/run-pass/record-pat.rs +++ b/src/test/run-pass/record-pat.rs @@ -20,6 +20,6 @@ fn m(input: t3) -> int { } pub fn main() { - assert_eq!(m(t3::c(T2 {x: t1::a(10), y: 5}, 4u)), 10); - assert_eq!(m(t3::c(T2 {x: t1::b(10u), y: 5}, 4u)), 19); + assert_eq!(m(t3::c(T2 {x: t1::a(10), y: 5}, 4_usize)), 10); + assert_eq!(m(t3::c(T2 {x: t1::b(10_usize), y: 5}, 4_usize)), 19); } diff --git a/src/test/run-pass/regions-borrow-at.rs b/src/test/run-pass/regions-borrow-at.rs index ba86e3f7b57..89779fa4d2d 100644 --- a/src/test/run-pass/regions-borrow-at.rs +++ b/src/test/run-pass/regions-borrow-at.rs @@ -16,8 +16,8 @@ fn foo(x: &uint) -> uint { } pub fn main() { - let p = box 22u; + let p = box 22_usize; let r = foo(&*p); println!("r={}", r); - assert_eq!(r, 22u); + assert_eq!(r, 22_usize); } diff --git a/src/test/run-pass/regions-borrow-uniq.rs b/src/test/run-pass/regions-borrow-uniq.rs index 30a22512d2a..a1af7159a93 100644 --- a/src/test/run-pass/regions-borrow-uniq.rs +++ b/src/test/run-pass/regions-borrow-uniq.rs @@ -16,7 +16,7 @@ fn foo(x: &uint) -> uint { } pub fn main() { - let p = box 3u; + let p = box 3_usize; let r = foo(&*p); - assert_eq!(r, 3u); + assert_eq!(r, 3_usize); } diff --git a/src/test/run-pass/regions-escape-into-other-fn.rs b/src/test/run-pass/regions-escape-into-other-fn.rs index 9637c43170f..b15f9d34859 100644 --- a/src/test/run-pass/regions-escape-into-other-fn.rs +++ b/src/test/run-pass/regions-escape-into-other-fn.rs @@ -15,6 +15,6 @@ fn foo(x: &uint) -> &uint { x } fn bar(x: &uint) -> uint { *x } pub fn main() { - let p = box 3u; + let p = box 3_usize; assert_eq!(bar(foo(&*p)), 3); } diff --git a/src/test/run-pass/regions-infer-borrow-scope-addr-of.rs b/src/test/run-pass/regions-infer-borrow-scope-addr-of.rs index dcf694899c1..9f1a383fd64 100644 --- a/src/test/run-pass/regions-infer-borrow-scope-addr-of.rs +++ b/src/test/run-pass/regions-infer-borrow-scope-addr-of.rs @@ -13,7 +13,7 @@ use std::mem::swap; pub fn main() { let mut x = 4; - for i in 0u..3 { + for i in 0_usize..3 { // ensure that the borrow in this alt // does not interfere with the swap // below. note that it would it you diff --git a/src/test/run-pass/regions-params.rs b/src/test/run-pass/regions-params.rs index 0042d3a765b..c71953e20f8 100644 --- a/src/test/run-pass/regions-params.rs +++ b/src/test/run-pass/regions-params.rs @@ -21,6 +21,6 @@ fn parameterized(x: &uint) -> uint { } pub fn main() { - let x = 3u; - assert_eq!(parameterized(&x), 3u); + let x = 3_usize; + assert_eq!(parameterized(&x), 3_usize); } diff --git a/src/test/run-pass/regions-refcell.rs b/src/test/run-pass/regions-refcell.rs index 019db2a977e..10c9aef7c3b 100644 --- a/src/test/run-pass/regions-refcell.rs +++ b/src/test/run-pass/regions-refcell.rs @@ -18,7 +18,7 @@ use std::cell::RefCell; // This version does not yet work (associated type issues)... #[cfg(cannot_use_this_yet)] fn foo<'a>(map: RefCell>) { - let one = [1u]; + let one = [1_usize]; assert_eq!(map.borrow().get("one"), Some(&one[])); } @@ -26,7 +26,7 @@ fn foo<'a>(map: RefCell>) { // ... and this version does not work (the lifetime of `one` is // supposed to match the lifetime `'a`) ... fn foo<'a>(map: RefCell>) { - let one = [1u]; + let one = [1_usize]; assert_eq!(map.borrow().get("one"), Some(&one.as_slice())); } diff --git a/src/test/run-pass/rename-directory.rs b/src/test/run-pass/rename-directory.rs index 12e4f27a64f..a21b5aa1dab 100644 --- a/src/test/run-pass/rename-directory.rs +++ b/src/test/run-pass/rename-directory.rs @@ -34,15 +34,15 @@ fn rename_directory() { let fromp = CString::from_slice(test_file.as_vec()); let modebuf = CString::from_slice(b"w+b"); let ostream = libc::fopen(fromp.as_ptr(), modebuf.as_ptr()); - assert!((ostream as uint != 0u)); + assert!((ostream as uint != 0_usize)); let s = "hello".to_string(); let buf = CString::from_slice(b"hello"); let write_len = libc::fwrite(buf.as_ptr() as *mut _, - 1u as libc::size_t, - (s.len() + 1u) as libc::size_t, + 1_usize as libc::size_t, + (s.len() + 1_usize) as libc::size_t, ostream); assert_eq!(write_len, (s.len() + 1) as libc::size_t); - assert_eq!(libc::fclose(ostream), (0u as libc::c_int)); + assert_eq!(libc::fclose(ostream), (0_usize as libc::c_int)); let new_path = tmpdir.join_many(&["quux", "blat"]); fs::mkdir_recursive(&new_path, old_io::USER_RWX); diff --git a/src/test/run-pass/ret-bang.rs b/src/test/run-pass/ret-bang.rs index ff4932e8453..74227192cab 100644 --- a/src/test/run-pass/ret-bang.rs +++ b/src/test/run-pass/ret-bang.rs @@ -14,11 +14,11 @@ fn my_err(s: String) -> ! { println!("{}", s); panic!(); } fn okay(i: uint) -> int { - if i == 3u { + if i == 3_usize { my_err("I don't like three".to_string()); } else { return 42; } } -pub fn main() { okay(4u); } +pub fn main() { okay(4_usize); } diff --git a/src/test/run-pass/sendfn-is-a-block.rs b/src/test/run-pass/sendfn-is-a-block.rs index c70ed9a3d74..18519573c26 100644 --- a/src/test/run-pass/sendfn-is-a-block.rs +++ b/src/test/run-pass/sendfn-is-a-block.rs @@ -10,10 +10,10 @@ fn test(f: F) -> uint where F: FnOnce(uint) -> uint { - return f(22u); + return f(22_usize); } pub fn main() { - let y = test(|x| 4u * x); - assert_eq!(y, 88u); + let y = test(|x| 4_usize * x); + assert_eq!(y, 88_usize); } diff --git a/src/test/run-pass/shift.rs b/src/test/run-pass/shift.rs index 2dbedc3a573..918da535099 100644 --- a/src/test/run-pass/shift.rs +++ b/src/test/run-pass/shift.rs @@ -54,28 +54,28 @@ fn test_expr() { } fn test_const() { - static r1_1: uint = 10u >> 2u; - static r2_1: uint = 10u << 4u; + static r1_1: uint = 10_usize >> 2_usize; + static r2_1: uint = 10_usize << 4_usize; assert_eq!(r1_1, 2 as uint); assert_eq!(r2_1, 160 as uint); - static r1_2: u8 = 10u8 >> 2u; - static r2_2: u8 = 10u8 << 4u; + static r1_2: u8 = 10u8 >> 2_usize; + static r2_2: u8 = 10u8 << 4_usize; assert_eq!(r1_2, 2 as u8); assert_eq!(r2_2, 160 as u8); - static r1_3: int = 10 >> 2u; - static r2_3: int = 10 << 4u; + static r1_3: int = 10 >> 2_usize; + static r2_3: int = 10 << 4_usize; assert_eq!(r1_3, 2 as int); assert_eq!(r2_3, 160 as int); - static r1_4: i8 = 10i8 >> 2u; - static r2_4: i8 = 10i8 << 4u; + static r1_4: i8 = 10i8 >> 2_usize; + static r2_4: i8 = 10i8 << 4_usize; assert_eq!(r1_4, 2 as i8); assert_eq!(r2_4, 160 as i8); - static r1_5: uint = 10u >> 2u; - static r2_5: uint = 10u << 4u; + static r1_5: uint = 10_usize >> 2_usize; + static r2_5: uint = 10_usize << 4_usize; assert_eq!(r1_5, 2 as uint); assert_eq!(r2_5, 160 as uint); } diff --git a/src/test/run-pass/signed-shift-const-eval.rs b/src/test/run-pass/signed-shift-const-eval.rs index 62f1ca63144..2acb93f48f9 100644 --- a/src/test/run-pass/signed-shift-const-eval.rs +++ b/src/test/run-pass/signed-shift-const-eval.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -enum test { thing = -5 >> 1u } +enum test { thing = -5 >> 1_usize } pub fn main() { assert_eq!(test::thing as int, -3); } diff --git a/src/test/run-pass/stat.rs b/src/test/run-pass/stat.rs index c22b476e59c..87d7376c243 100644 --- a/src/test/run-pass/stat.rs +++ b/src/test/run-pass/stat.rs @@ -20,7 +20,7 @@ pub fn main() { Err(..) => unreachable!(), Ok(f) => { let mut f = f; - for _ in 0u..1000 { + for _ in 0_usize..1000 { f.write(&[0]); } } diff --git a/src/test/run-pass/static-impl.rs b/src/test/run-pass/static-impl.rs index ff37ccb81ed..b66999c8e67 100644 --- a/src/test/run-pass/static-impl.rs +++ b/src/test/run-pass/static-impl.rs @@ -34,8 +34,8 @@ impl uint_utils for uint { self.to_string() } fn multi(&self, mut f: F) where F: FnMut(uint) { - let mut c = 0u; - while c < *self { f(c); c += 1u; } + let mut c = 0_usize; + while c < *self { f(c); c += 1_usize; } } } @@ -58,15 +58,15 @@ impl vec_utils for Vec { } pub fn main() { - assert_eq!(10u.plus(), 30); + assert_eq!(10_usize.plus(), 30); assert_eq!(("hi".to_string()).plus(), 200); assert_eq!((vec!(1)).length_().str(), "1".to_string()); let vect = vec!(3, 4).map_(|a| *a + 4); assert_eq!(vect[0], 7); - let vect = (vec!(3, 4)).map_::(|a| *a as uint + 4u); - assert_eq!(vect[0], 7u); - let mut x = 0u; - 10u.multi(|_n| x += 2u ); - assert_eq!(x, 20u); + let vect = (vec!(3, 4)).map_::(|a| *a as uint + 4_usize); + assert_eq!(vect[0], 7_usize); + let mut x = 0_usize; + 10_usize.multi(|_n| x += 2_usize ); + assert_eq!(x, 20_usize); } diff --git a/src/test/run-pass/static-methods-in-traits.rs b/src/test/run-pass/static-methods-in-traits.rs index 180cd115c96..5f6dc4f2a53 100644 --- a/src/test/run-pass/static-methods-in-traits.rs +++ b/src/test/run-pass/static-methods-in-traits.rs @@ -21,7 +21,7 @@ mod a { impl Foo for uint { fn foo() -> uint { - 5u + 5_usize } } } diff --git a/src/test/run-pass/string-self-append.rs b/src/test/run-pass/string-self-append.rs index 612483f6909..359c14ea7b0 100644 --- a/src/test/run-pass/string-self-append.rs +++ b/src/test/run-pass/string-self-append.rs @@ -12,12 +12,12 @@ pub fn main() { // Make sure we properly handle repeated self-appends. let mut a: String = "A".to_string(); let mut i = 20; - let mut expected_len = 1u; + let mut expected_len = 1_usize; while i > 0 { println!("{}", a.len()); assert_eq!(a.len(), expected_len); a = format!("{}{}", a, a); i -= 1; - expected_len *= 2u; + expected_len *= 2_usize; } } diff --git a/src/test/run-pass/supported-cast.rs b/src/test/run-pass/supported-cast.rs index 60431fbedd0..3fffef060a1 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 = 1u as *const libc::FILE; + let f = 1_usize as *const libc::FILE; println!("{:?}", f as int); println!("{:?}", f as uint); println!("{:?}", f as i8); @@ -37,19 +37,19 @@ pub fn main() { println!("{:?}", 1 as f32); println!("{:?}", 1 as f64); - println!("{:?}", 1u as int); - println!("{:?}", 1u as uint); - println!("{:?}", 1u as *const libc::FILE); - println!("{:?}", 1u as i8); - println!("{:?}", 1u as i16); - println!("{:?}", 1u as i32); - println!("{:?}", 1u as i64); - println!("{:?}", 1u as u8); - println!("{:?}", 1u as u16); - println!("{:?}", 1u as u32); - println!("{:?}", 1u as u64); - println!("{:?}", 1u as f32); - println!("{:?}", 1u as f64); + println!("{:?}", 1_usize as int); + println!("{:?}", 1_usize as uint); + println!("{:?}", 1_usize as *const libc::FILE); + println!("{:?}", 1_usize as i8); + println!("{:?}", 1_usize as i16); + println!("{:?}", 1_usize as i32); + println!("{:?}", 1_usize as i64); + println!("{:?}", 1_usize as u8); + println!("{:?}", 1_usize as u16); + println!("{:?}", 1_usize as u32); + println!("{:?}", 1_usize as u64); + println!("{:?}", 1_usize as f32); + println!("{:?}", 1_usize as f64); println!("{:?}", 1i8 as int); println!("{:?}", 1i8 as uint); diff --git a/src/test/run-pass/syntax-extension-source-utils-files/includeme.fragment b/src/test/run-pass/syntax-extension-source-utils-files/includeme.fragment index 5d326a50f02..dea7f99fcba 100644 --- a/src/test/run-pass/syntax-extension-source-utils-files/includeme.fragment +++ b/src/test/run-pass/syntax-extension-source-utils-files/includeme.fragment @@ -2,6 +2,6 @@ { assert!(file!().ends_with("includeme.fragment")); - assert!(line!() == 5u); + assert!(line!() == 5_usize); format!("victory robot {}", line!()) } diff --git a/src/test/run-pass/tag-align-dyn-u64.rs b/src/test/run-pass/tag-align-dyn-u64.rs index 7805204aa05..b7fe4983b01 100644 --- a/src/test/run-pass/tag-align-dyn-u64.rs +++ b/src/test/run-pass/tag-align-dyn-u64.rs @@ -28,7 +28,7 @@ fn mk_rec() -> Rec { fn is_8_byte_aligned(u: &Tag) -> bool { let p: uint = unsafe { mem::transmute(u) }; - return (p & 7u) == 0u; + return (p & 7_usize) == 0_usize; } pub fn main() { diff --git a/src/test/run-pass/tag-align-dyn-variants.rs b/src/test/run-pass/tag-align-dyn-variants.rs index aef9e23ce49..cb298e720ed 100644 --- a/src/test/run-pass/tag-align-dyn-variants.rs +++ b/src/test/run-pass/tag-align-dyn-variants.rs @@ -31,7 +31,7 @@ fn mk_rec(a: A, b: B) -> Rec { fn is_aligned(amnt: uint, u: &A) -> bool { let p: uint = unsafe { mem::transmute(u) }; - return (p & (amnt-1u)) == 0u; + return (p & (amnt-1_usize)) == 0_usize; } fn variant_data_is_aligned(amnt: uint, u: &Tag) -> bool { @@ -43,32 +43,32 @@ fn variant_data_is_aligned(amnt: uint, u: &Tag) -> bool { pub fn main() { let x = mk_rec(22u64, 23u64); - assert!(is_aligned(8u, &x.tA)); - assert!(variant_data_is_aligned(8u, &x.tA)); - assert!(is_aligned(8u, &x.tB)); - assert!(variant_data_is_aligned(8u, &x.tB)); + assert!(is_aligned(8_usize, &x.tA)); + assert!(variant_data_is_aligned(8_usize, &x.tA)); + assert!(is_aligned(8_usize, &x.tB)); + assert!(variant_data_is_aligned(8_usize, &x.tB)); let x = mk_rec(22u64, 23u32); - assert!(is_aligned(8u, &x.tA)); - assert!(variant_data_is_aligned(8u, &x.tA)); - assert!(is_aligned(8u, &x.tB)); - assert!(variant_data_is_aligned(4u, &x.tB)); + assert!(is_aligned(8_usize, &x.tA)); + assert!(variant_data_is_aligned(8_usize, &x.tA)); + assert!(is_aligned(8_usize, &x.tB)); + assert!(variant_data_is_aligned(4_usize, &x.tB)); let x = mk_rec(22u32, 23u64); - assert!(is_aligned(8u, &x.tA)); - assert!(variant_data_is_aligned(4u, &x.tA)); - assert!(is_aligned(8u, &x.tB)); - assert!(variant_data_is_aligned(8u, &x.tB)); + assert!(is_aligned(8_usize, &x.tA)); + assert!(variant_data_is_aligned(4_usize, &x.tA)); + assert!(is_aligned(8_usize, &x.tB)); + assert!(variant_data_is_aligned(8_usize, &x.tB)); let x = mk_rec(22u32, 23u32); - assert!(is_aligned(4u, &x.tA)); - assert!(variant_data_is_aligned(4u, &x.tA)); - assert!(is_aligned(4u, &x.tB)); - assert!(variant_data_is_aligned(4u, &x.tB)); + assert!(is_aligned(4_usize, &x.tA)); + assert!(variant_data_is_aligned(4_usize, &x.tA)); + assert!(is_aligned(4_usize, &x.tB)); + assert!(variant_data_is_aligned(4_usize, &x.tB)); let x = mk_rec(22f64, 23f64); - assert!(is_aligned(8u, &x.tA)); - assert!(variant_data_is_aligned(8u, &x.tA)); - assert!(is_aligned(8u, &x.tB)); - assert!(variant_data_is_aligned(8u, &x.tB)); + assert!(is_aligned(8_usize, &x.tA)); + assert!(variant_data_is_aligned(8_usize, &x.tA)); + assert!(is_aligned(8_usize, &x.tB)); + assert!(variant_data_is_aligned(8_usize, &x.tB)); } diff --git a/src/test/run-pass/tag-align-u64.rs b/src/test/run-pass/tag-align-u64.rs index be84888477c..713f55cc10c 100644 --- a/src/test/run-pass/tag-align-u64.rs +++ b/src/test/run-pass/tag-align-u64.rs @@ -28,7 +28,7 @@ fn mk_rec() -> Rec { fn is_8_byte_aligned(u: &Tag) -> bool { let p: uint = unsafe { mem::transmute(u) }; - return (p & 7u) == 0u; + return (p & 7_usize) == 0_usize; } pub fn main() { diff --git a/src/test/run-pass/task-comm-12.rs b/src/test/run-pass/task-comm-12.rs index da080408ad1..08dce2a7648 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 = 0u; + let mut i = 0_usize; while i < 10000 { Thread::yield_now(); i += 1; diff --git a/src/test/run-pass/tcp-connect-timeouts.rs b/src/test/run-pass/tcp-connect-timeouts.rs index 69ae2521f9a..d1a3edcfbc5 100644 --- a/src/test/run-pass/tcp-connect-timeouts.rs +++ b/src/test/run-pass/tcp-connect-timeouts.rs @@ -41,7 +41,7 @@ fn eventual_timeout() { rx1.recv().unwrap(); let mut v = Vec::new(); - for _ in 0u..10000 { + for _ in 0_usize..10000 { match TcpStream::connect_timeout(addr, Duration::milliseconds(100)) { Ok(e) => v.push(e), Err(ref e) if e.kind == old_io::TimedOut => return, diff --git a/src/test/run-pass/tcp-stress.rs b/src/test/run-pass/tcp-stress.rs index e0527c35871..82584c83de0 100644 --- a/src/test/run-pass/tcp-stress.rs +++ b/src/test/run-pass/tcp-stress.rs @@ -52,7 +52,7 @@ fn main() { let addr = rx.recv().unwrap(); let (tx, rx) = channel(); - for _ in 0u..1000 { + for _ in 0_usize..1000 { let tx = tx.clone(); Builder::new().stack_size(64 * 1024).spawn(move|| { match TcpStream::connect(addr) { @@ -71,7 +71,7 @@ fn main() { // Wait for all clients to exit, but don't wait for the server to exit. The // server just runs infinitely. drop(tx); - for _ in 0u..1000 { + for _ in 0_usize..1000 { rx.recv().unwrap(); } unsafe { libc::exit(0) } diff --git a/src/test/run-pass/trait-default-method-bound-subst4.rs b/src/test/run-pass/trait-default-method-bound-subst4.rs index fdc42e58f8c..3efe2507470 100644 --- a/src/test/run-pass/trait-default-method-bound-subst4.rs +++ b/src/test/run-pass/trait-default-method-bound-subst4.rs @@ -20,6 +20,6 @@ fn f>(i: V, j: uint) -> uint { } pub fn main () { - assert_eq!(f::(0, 2u), 2u); - assert_eq!(f::(0, 2u), 2u); + assert_eq!(f::(0, 2_usize), 2_usize); + assert_eq!(f::(0, 2_usize), 2_usize); } diff --git a/src/test/run-pass/type-params-in-for-each.rs b/src/test/run-pass/type-params-in-for-each.rs index 24cc5fab8ed..cf8a09998da 100644 --- a/src/test/run-pass/type-params-in-for-each.rs +++ b/src/test/run-pass/type-params-in-for-each.rs @@ -16,11 +16,11 @@ struct S { fn range_(lo: uint, hi: uint, mut it: F) where F: FnMut(uint) { let mut lo_ = lo; - while lo_ < hi { it(lo_); lo_ += 1u; } + while lo_ < hi { it(lo_); lo_ += 1_usize; } } fn create_index(_index: Vec> , _hash_fn: extern fn(T) -> uint) { - range_(0u, 256u, |_i| { + range_(0_usize, 256_usize, |_i| { let _bucket: Vec = Vec::new(); }) } diff --git a/src/test/run-pass/typeck_type_placeholder_1.rs b/src/test/run-pass/typeck_type_placeholder_1.rs index d7748f24774..48dc9443821 100644 --- a/src/test/run-pass/typeck_type_placeholder_1.rs +++ b/src/test/run-pass/typeck_type_placeholder_1.rs @@ -21,17 +21,17 @@ static CONSTEXPR: TestStruct = TestStruct{x: &413 as *const _}; pub fn main() { - let x: Vec<_> = (0u..5).collect(); + let x: Vec<_> = (0_usize..5).collect(); let expected: &[uint] = &[0,1,2,3,4]; assert_eq!(x, expected); - let x = (0u..5).collect::>(); + let x = (0_usize..5).collect::>(); assert_eq!(x, expected); let y: _ = "hello"; assert_eq!(y.len(), 5); - let ptr = &5u; + let ptr = &5_usize; let ptr2 = ptr as *const _; assert_eq!(ptr as *const uint as uint, ptr2 as uint); diff --git a/src/test/run-pass/unboxed-closures-by-ref.rs b/src/test/run-pass/unboxed-closures-by-ref.rs index f1435b43f80..178865897e5 100644 --- a/src/test/run-pass/unboxed-closures-by-ref.rs +++ b/src/test/run-pass/unboxed-closures-by-ref.rs @@ -25,8 +25,8 @@ fn call_fn_once(f: F) { } fn main() { - let mut x = 0u; - let y = 2u; + let mut x = 0_usize; + let y = 2_usize; call_fn(|| assert_eq!(x, 0)); call_fn_mut(|| x += y); diff --git a/src/test/run-pass/unboxed-closures-cross-crate.rs b/src/test/run-pass/unboxed-closures-cross-crate.rs index 3babaa2b7e5..96d75592627 100644 --- a/src/test/run-pass/unboxed-closures-cross-crate.rs +++ b/src/test/run-pass/unboxed-closures-cross-crate.rs @@ -15,6 +15,6 @@ extern crate "unboxed-closures-cross-crate" as ubcc; fn main() { - assert_eq!(ubcc::has_closures(), 2u); - assert_eq!(ubcc::has_generic_closures(2u, 3u), 5u); + assert_eq!(ubcc::has_closures(), 2_usize); + assert_eq!(ubcc::has_generic_closures(2_usize, 3_usize), 5_usize); } diff --git a/src/test/run-pass/unboxed-closures-infer-kind.rs b/src/test/run-pass/unboxed-closures-infer-kind.rs index 0cb719ecd7f..36c8400be78 100644 --- a/src/test/run-pass/unboxed-closures-infer-kind.rs +++ b/src/test/run-pass/unboxed-closures-infer-kind.rs @@ -28,8 +28,8 @@ fn call_fn_once(f: F) { } fn main() { - let mut x = 0u; - let y = 2u; + let mut x = 0_usize; + let y = 2_usize; call_fn(|| assert_eq!(x, 0)); call_fn_mut(|| x += y); diff --git a/src/test/run-pass/unboxed-closures-move-mutable.rs b/src/test/run-pass/unboxed-closures-move-mutable.rs index 0d04aee2a15..069e93b86ba 100644 --- a/src/test/run-pass/unboxed-closures-move-mutable.rs +++ b/src/test/run-pass/unboxed-closures-move-mutable.rs @@ -20,19 +20,19 @@ fn set(x: &mut uint) { *x = 42; } fn main() { { - let mut x = 0u; + let mut x = 0_usize; move || x += 1; } { - let mut x = 0u; + let mut x = 0_usize; move || x += 1; } { - let mut x = 0u; + let mut x = 0_usize; move || set(&mut x); } { - let mut x = 0u; + let mut x = 0_usize; move || set(&mut x); } } diff --git a/src/test/run-pass/unboxed-closures-unique-type-id.rs b/src/test/run-pass/unboxed-closures-unique-type-id.rs index 2871b5c6862..5c36832d9f6 100644 --- a/src/test/run-pass/unboxed-closures-unique-type-id.rs +++ b/src/test/run-pass/unboxed-closures-unique-type-id.rs @@ -28,8 +28,8 @@ pub fn replace_map<'a, T, F>(src: &mut T, prod: F) where F: FnOnce(T) -> T { } pub fn main() { - let mut a = 7u; + let mut a = 7_usize; let b = &mut a; replace_map(b, |x: uint| x * 2); - assert_eq!(*b, 14u); + assert_eq!(*b, 14_usize); } diff --git a/src/test/run-pass/unify-return-ty.rs b/src/test/run-pass/unify-return-ty.rs index a189d4528ae..1a65f685a5e 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(0u) + mem::transmute(0_usize) } } diff --git a/src/test/run-pass/unique-pat-2.rs b/src/test/run-pass/unique-pat-2.rs index 826ba8c8cdd..5db96bc3564 100644 --- a/src/test/run-pass/unique-pat-2.rs +++ b/src/test/run-pass/unique-pat-2.rs @@ -17,7 +17,7 @@ struct Foo {a: int, b: uint} enum bar { u(Box), w(int), } pub fn main() { - assert!(match bar::u(box Foo{a: 10, b: 40u}) { + assert!(match bar::u(box Foo{a: 10, b: 40_usize}) { bar::u(box Foo{a: a, b: b}) => { a + (b as int) } _ => { 66 } } == 50); diff --git a/src/test/run-pass/unique-send-2.rs b/src/test/run-pass/unique-send-2.rs index 08ffe403696..43824812ec5 100644 --- a/src/test/run-pass/unique-send-2.rs +++ b/src/test/run-pass/unique-send-2.rs @@ -20,9 +20,9 @@ fn child(tx: &Sender>, i: uint) { pub fn main() { let (tx, rx) = channel(); - let n = 100u; - let mut expected = 0u; - let _t = (0u..n).map(|i| { + let n = 100_usize; + let mut expected = 0_usize; + let _t = (0_usize..n).map(|i| { expected += i; let tx = tx.clone(); thread::spawn(move|| { @@ -30,8 +30,8 @@ pub fn main() { }) }).collect::>(); - let mut actual = 0u; - for _ in 0u..n { + let mut actual = 0_usize; + for _ in 0_usize..n { let j = rx.recv().unwrap(); actual += *j; } diff --git a/src/test/run-pass/utf8_chars.rs b/src/test/run-pass/utf8_chars.rs index 1b2aa88cabe..84f605eef57 100644 --- a/src/test/run-pass/utf8_chars.rs +++ b/src/test/run-pass/utf8_chars.rs @@ -18,12 +18,12 @@ pub fn main() { let s: String = chs.iter().cloned().collect(); let schs: Vec = s.chars().collect(); - assert!(s.len() == 10u); - assert!(s.chars().count() == 4u); - assert!(schs.len() == 4u); + assert!(s.len() == 10_usize); + assert!(s.chars().count() == 4_usize); + assert!(schs.len() == 4_usize); assert!(schs.iter().cloned().collect::() == s); - assert!(s.char_at(0u) == 'e'); - assert!(s.char_at(1u) == 'é'); + assert!(s.char_at(0_usize) == 'e'); + assert!(s.char_at(1_usize) == 'é'); assert!((str::from_utf8(s.as_bytes()).is_ok())); // invalid prefix diff --git a/src/test/run-pass/utf8_idents.rs b/src/test/run-pass/utf8_idents.rs index 0e6f20358aa..beb2f4d9969 100644 --- a/src/test/run-pass/utf8_idents.rs +++ b/src/test/run-pass/utf8_idents.rs @@ -30,7 +30,7 @@ fn საჭმელად_გემრიელი_სადილი() -> int let 午餐 = 10; let ארוחת_צהריי = 10; - let غداء = 10u; + let غداء = 10_usize; let լանչ = 10; let обед = 10; let абед = 10; diff --git a/src/test/run-pass/vec-fixed-length.rs b/src/test/run-pass/vec-fixed-length.rs index 101999bbe08..015baea5fb5 100644 --- a/src/test/run-pass/vec-fixed-length.rs +++ b/src/test/run-pass/vec-fixed-length.rs @@ -17,11 +17,11 @@ pub fn main() { assert_eq!(x[2], 3); assert_eq!(x[3], 4); - assert_eq!(size_of::<[u8; 4]>(), 4u); + assert_eq!(size_of::<[u8; 4]>(), 4_usize); // FIXME #10183 // FIXME #18069 //if cfg!(target_pointer_width = "64") { - // assert_eq!(size_of::<[u8; (1 << 32)]>(), (1u << 32)); + // assert_eq!(size_of::<[u8; (1 << 32)]>(), (1_usize << 32)); //} } diff --git a/src/test/run-pass/vector-sort-panic-safe.rs b/src/test/run-pass/vector-sort-panic-safe.rs index da9cf35813b..08d39e58b7c 100644 --- a/src/test/run-pass/vector-sort-panic-safe.rs +++ b/src/test/run-pass/vector-sort-panic-safe.rs @@ -67,7 +67,7 @@ pub fn main() { // work out the total number of comparisons required to sort // this array... - let mut count = 0us; + let mut count = 0_usize; main.clone().sort_by(|a, b| { count += 1; a.cmp(b) }); // ... and then panic on each and every single one. diff --git a/src/test/run-pass/weird-exprs.rs b/src/test/run-pass/weird-exprs.rs index c9f070a279c..baea1b8826a 100644 --- a/src/test/run-pass/weird-exprs.rs +++ b/src/test/run-pass/weird-exprs.rs @@ -65,7 +65,7 @@ fn canttouchthis() -> uint { fn p() -> bool { true } let _a = (assert!((true)) == (assert!(p()))); let _c = (assert!((p())) == ()); - let _b: bool = (println!("{}", 0) == (return 0u)); + let _b: bool = (println!("{}", 0) == (return 0_usize)); } fn angrydome() { diff --git a/src/test/run-pass/while-flow-graph.rs b/src/test/run-pass/while-flow-graph.rs index 01c5986b130..8239afb3594 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 = 0xf00u; } } +pub fn main() { let x: int = 10; while x == 10 && x == 11 { let _y = 0xf00_usize; } } diff --git a/src/test/run-pass/x86stdcall.rs b/src/test/run-pass/x86stdcall.rs index 75a8f6019b8..5dd0a5522c6 100644 --- a/src/test/run-pass/x86stdcall.rs +++ b/src/test/run-pass/x86stdcall.rs @@ -22,7 +22,7 @@ mod kernel32 { #[cfg(windows)] pub fn main() { unsafe { - let expected = 1234u; + let expected = 1234_usize; kernel32::SetLastError(expected); let actual = kernel32::GetLastError(); println!("actual = {}", actual); diff --git a/src/test/run-pass/x86stdcall2.rs b/src/test/run-pass/x86stdcall2.rs index 522e5fd978e..86c1ae0f51f 100644 --- a/src/test/run-pass/x86stdcall2.rs +++ b/src/test/run-pass/x86stdcall2.rs @@ -31,7 +31,7 @@ mod kernel32 { pub fn main() { let heap = unsafe { kernel32::GetProcessHeap() }; let mem = unsafe { kernel32::HeapAlloc(heap, 0u32, 100u32) }; - assert!(mem != 0u); + assert!(mem != 0_usize); let res = unsafe { kernel32::HeapFree(heap, 0u32, mem) }; assert!(res != 0u8); }