1
Fork 0

Update suffixes en masse in tests using perl -p -i -e

This commit is contained in:
Niko Matsakis 2015-02-18 05:42:01 -05:00
parent 8c34b26606
commit 72eb214ee4
266 changed files with 639 additions and 639 deletions

View file

@ -16,7 +16,7 @@ pub mod kitties {
} }
impl 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 } pub fn meow_count(&mut self) -> uint { self.meows }
} }

View file

@ -34,8 +34,8 @@ pub mod kitties {
impl cat { impl cat {
pub fn meow(&mut self) { pub fn meow(&mut self) {
println!("Meow"); println!("Meow");
self.meows += 1u; self.meows += 1_usize;
if self.meows % 5u == 0u { if self.meows % 5_usize == 0_usize {
self.how_hungry += 1; self.how_hungry += 1;
} }
} }

View file

@ -26,8 +26,8 @@ pub mod kitty {
impl cat { impl cat {
fn meow(&mut self) { fn meow(&mut self) {
println!("Meow"); println!("Meow");
self.meows += 1u; self.meows += 1_usize;
if self.meows % 5u == 0u { if self.meows % 5_usize == 0_usize {
self.how_hungry += 1; self.how_hungry += 1;
} }
} }

View file

@ -20,7 +20,7 @@ impl uint_helpers for uint {
let mut i = *self; let mut i = *self;
while i < v { while i < v {
f(i); f(i);
i += 1u; i += 1_usize;
} }
} }
} }

View file

@ -12,10 +12,10 @@
#[inline] #[inline]
pub fn iter<T, F>(v: &[T], mut f: F) where F: FnMut(&T) { pub fn iter<T, F>(v: &[T], mut f: F) where F: FnMut(&T) {
let mut i = 0u; let mut i = 0_usize;
let n = v.len(); let n = v.len();
while i < n { while i < n {
f(&v[i]); f(&v[i]);
i += 1u; i += 1_usize;
} }
} }

View file

@ -13,10 +13,10 @@
// same as cci_iter_lib, more-or-less, but not marked inline // same as cci_iter_lib, more-or-less, but not marked inline
pub fn iter<F>(v: Vec<uint> , mut f: F) where F: FnMut(uint) { pub fn iter<F>(v: Vec<uint> , mut f: F) where F: FnMut(uint) {
let mut i = 0u; let mut i = 0_usize;
let n = v.len(); let n = v.len();
while i < n { while i < n {
f(v[i]); f(v[i]);
i += 1u; i += 1_usize;
} }
} }

View file

@ -11,5 +11,5 @@
#![crate_type = "dylib"] #![crate_type = "dylib"]
#[macro_export] #[macro_export]
macro_rules! reexported { macro_rules! reexported {
() => ( 3u ) () => ( 3_usize )
} }

View file

@ -47,7 +47,7 @@ fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
}; };
let mut text = &*text; let mut text = &*text;
let mut total = 0u; let mut total = 0_usize;
while !text.is_empty() { while !text.is_empty() {
match NUMERALS.iter().find(|&&(rn, _)| text.starts_with(rn)) { match NUMERALS.iter().find(|&&(rn, _)| text.starts_with(rn)) {
Some(&(rn, val)) => { Some(&(rn, val)) => {

View file

@ -14,9 +14,9 @@ use std::ops::Add;
#[inline] #[inline]
pub fn has_closures() -> uint { pub fn has_closures() -> uint {
let x = 1u; let x = 1_usize;
let mut f = move || x; let mut f = move || x;
let y = 1u; let y = 1_usize;
let g = || y; let g = || y;
f() + g() f() + g()
} }

View file

@ -104,9 +104,9 @@ fn main() {
let mut pixels = [0f32; 256*256]; let mut pixels = [0f32; 256*256];
let n2d = Noise2DContext::new(); let n2d = Noise2DContext::new();
for _ in 0u..100 { for _ in 0..100 {
for y in 0u..256 { for y in 0..256 {
for x in 0u..256 { for x in 0..256 {
let v = n2d.get(x as f32 * 0.1, y as f32 * 0.1); let v = n2d.get(x as f32 * 0.1, y as f32 * 0.1);
pixels[y*256+x] = v * 0.5 + 0.5; pixels[y*256+x] = v * 0.5 + 0.5;
} }

View file

@ -15,6 +15,6 @@ pub use use_from_trait_xc::Trait;
fn main() { fn main() {
match () { 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
} }
} }

View file

@ -28,7 +28,7 @@ pub fn main() {
unsafe { unsafe {
// comma in place of a colon // 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 //~^ WARNING expected a clobber, found an option
} }
assert_eq!(x, 13); assert_eq!(x, 13);

View file

@ -15,7 +15,7 @@ struct cat {
} }
impl 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 { fn cat(in_x : usize, in_y : isize) -> cat {
@ -26,6 +26,6 @@ fn cat(in_x : usize, in_y : isize) -> cat {
} }
fn main() { 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 nyan.speak = || println!("meow"); //~ ERROR attempted to take value of method
} }

View file

@ -10,5 +10,5 @@
fn main() { fn main() {
#[attr] //~ ERROR expected item #[attr] //~ ERROR expected item
let _i = 0; let __isize = 0;
} }

View file

@ -11,7 +11,7 @@
// Tests that a function with a ! annotation always actually fails // Tests that a function with a ! annotation always actually fails
fn bad_bang(i: usize) -> ! { 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); } fn main() { bad_bang(5); }

View file

@ -11,7 +11,7 @@
// Tests that a function with a ! annotation always actually fails // 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 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); } fn main() { bad_bang(5); }

View file

@ -9,7 +9,7 @@
// except according to those terms. // except according to those terms.
fn foo<T:'static>() { fn foo<T:'static>() {
1us.bar::<T>(); //~ ERROR `core::marker::Send` is not implemented 1_usize.bar::<T>(); //~ ERROR `core::marker::Send` is not implemented
} }
trait bar { trait bar {

View file

@ -21,25 +21,25 @@ fn to_fn_mut<A,F:FnMut<A>>(f: F) -> F { f }
fn main() { fn main() {
// By-ref captures // By-ref captures
{ {
let mut x = 0us; let mut x = 0_usize;
let _f = to_fn(|| x = 42); //~ ERROR cannot assign 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 _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 let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); }); //~ ERROR cannot assign
} }
// By-value captures // By-value captures
{ {
let mut x = 0us; let mut x = 0_usize;
let _f = to_fn(move || x = 42); //~ ERROR cannot assign 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 _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 let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); }); //~ ERROR cannot assign
} }
} }

View file

@ -56,15 +56,15 @@ impl Point {
} }
fn deref_imm_field(x: Own<Point>) { fn deref_imm_field(x: Own<Point>) {
let _i = &x.y; let __isize = &x.y;
} }
fn deref_mut_field1(x: Own<Point>) { fn deref_mut_field1(x: Own<Point>) {
let _i = &mut x.y; //~ ERROR cannot borrow let __isize = &mut x.y; //~ ERROR cannot borrow
} }
fn deref_mut_field2(mut x: Own<Point>) { fn deref_mut_field2(mut x: Own<Point>) {
let _i = &mut x.y; let __isize = &mut x.y;
} }
fn deref_extend_field(x: &Own<Point>) -> &isize { fn deref_extend_field(x: &Own<Point>) -> &isize {
@ -114,7 +114,7 @@ fn assign_field4<'a>(x: &'a mut Own<Point>) {
// FIXME(eddyb) #12825 This shouldn't attempt to call deref_mut. // FIXME(eddyb) #12825 This shouldn't attempt to call deref_mut.
/* /*
fn deref_imm_method(x: Own<Point>) { fn deref_imm_method(x: Own<Point>) {
let _i = x.get(); let __isize = x.get();
} }
*/ */

View file

@ -50,15 +50,15 @@ impl Point {
} }
fn deref_imm_field(x: Rc<Point>) { fn deref_imm_field(x: Rc<Point>) {
let _i = &x.y; let __isize = &x.y;
} }
fn deref_mut_field1(x: Rc<Point>) { fn deref_mut_field1(x: Rc<Point>) {
let _i = &mut x.y; //~ ERROR cannot borrow let __isize = &mut x.y; //~ ERROR cannot borrow
} }
fn deref_mut_field2(mut x: Rc<Point>) { fn deref_mut_field2(mut x: Rc<Point>) {
let _i = &mut x.y; //~ ERROR cannot borrow let __isize = &mut x.y; //~ ERROR cannot borrow
} }
fn deref_extend_field(x: &Rc<Point>) -> &isize { fn deref_extend_field(x: &Rc<Point>) -> &isize {
@ -86,7 +86,7 @@ fn assign_field3<'a>(x: &'a mut Rc<Point>) {
} }
fn deref_imm_method(x: Rc<Point>) { fn deref_imm_method(x: Rc<Point>) {
let _i = x.get(); let __isize = x.get();
} }
fn deref_mut_method1(x: Rc<Point>) { fn deref_mut_method1(x: Rc<Point>) {

View file

@ -32,15 +32,15 @@ impl<T> DerefMut for Own<T> {
} }
fn deref_imm(x: Own<isize>) { fn deref_imm(x: Own<isize>) {
let _i = &*x; let __isize = &*x;
} }
fn deref_mut1(x: Own<isize>) { fn deref_mut1(x: Own<isize>) {
let _i = &mut *x; //~ ERROR cannot borrow let __isize = &mut *x; //~ ERROR cannot borrow
} }
fn deref_mut2(mut x: Own<isize>) { fn deref_mut2(mut x: Own<isize>) {
let _i = &mut *x; let __isize = &mut *x;
} }
fn deref_extend<'a>(x: &'a Own<isize>) -> &'a isize { fn deref_extend<'a>(x: &'a Own<isize>) -> &'a isize {

View file

@ -26,15 +26,15 @@ impl<T> Deref for Rc<T> {
} }
fn deref_imm(x: Rc<isize>) { fn deref_imm(x: Rc<isize>) {
let _i = &*x; let __isize = &*x;
} }
fn deref_mut1(x: Rc<isize>) { fn deref_mut1(x: Rc<isize>) {
let _i = &mut *x; //~ ERROR cannot borrow let __isize = &mut *x; //~ ERROR cannot borrow
} }
fn deref_mut2(mut x: Rc<isize>) { fn deref_mut2(mut x: Rc<isize>) {
let _i = &mut *x; //~ ERROR cannot borrow let __isize = &mut *x; //~ ERROR cannot borrow
} }
fn deref_extend<'a>(x: &'a Rc<isize>) -> &'a isize { fn deref_extend<'a>(x: &'a Rc<isize>) -> &'a isize {

View file

@ -21,7 +21,7 @@ fn separate_arms() {
// fact no outstanding loan of x! // fact no outstanding loan of x!
x = Some(0); x = Some(0);
} }
Some(ref _i) => { Some(ref __isize) => {
x = Some(1); //~ ERROR cannot assign x = Some(1); //~ ERROR cannot assign
} }
} }

View file

@ -11,7 +11,7 @@
#![allow(dead_code)] #![allow(dead_code)]
fn main() { fn main() {
// Original borrow ends at end of function // Original borrow ends at end of function
let mut x = 1us; let mut x = 1_usize;
let y = &mut x; let y = &mut x;
let z = &x; //~ ERROR cannot borrow let z = &x; //~ ERROR cannot borrow
} }
@ -21,7 +21,7 @@ fn foo() {
match true { match true {
true => { true => {
// Original borrow ends at end of match arm // Original borrow ends at end of match arm
let mut x = 1us; let mut x = 1_usize;
let y = &x; let y = &x;
let z = &mut x; //~ ERROR cannot borrow let z = &mut x; //~ ERROR cannot borrow
} }
@ -33,7 +33,7 @@ fn foo() {
fn bar() { fn bar() {
// Original borrow ends at end of closure // Original borrow ends at end of closure
|| { || {
let mut x = 1us; let mut x = 1_usize;
let y = &mut x; let y = &mut x;
let z = &mut x; //~ ERROR cannot borrow let z = &mut x; //~ ERROR cannot borrow
}; };

View file

@ -27,5 +27,5 @@ fn cat(in_x : usize) -> cat {
} }
fn main() { fn main() {
let nyan = cat(0us); let nyan = cat(0_usize);
} }

View file

@ -16,7 +16,7 @@ impl cat {
fn sleep(&self) { loop{} } fn sleep(&self) { loop{} }
fn meow(&self) { fn meow(&self) {
println!("Meow"); println!("Meow");
meows += 1us; //~ ERROR unresolved name meows += 1_usize; //~ ERROR unresolved name
sleep(); //~ ERROR unresolved name sleep(); //~ ERROR unresolved name
} }

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // 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 //~^ ERROR: blocks in constants are limited to items and tail expressions
const B: usize = { { } 2 }; const B: usize = { { } 2 };
@ -19,7 +19,7 @@ macro_rules! foo {
} }
const C: usize = { foo!(); 2 }; 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 //~^ ERROR: blocks in constants are limited to items and tail expressions
pub fn main() { pub fn main() {

View file

@ -22,10 +22,10 @@ impl S { }
impl T for S { } impl T for S { }
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums #[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 #[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 #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
mod m { } mod m { }

View file

@ -16,7 +16,7 @@ mod u {
x: uint //~ WARN the `uint` type is deprecated x: uint //~ WARN the `uint` type is deprecated
} }
fn bar(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 { mod i {
@ -25,7 +25,7 @@ mod i {
x: int //~ WARN the `int` type is deprecated x: int //~ WARN the `int` type is deprecated
} }
fn bar(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;
} }
} }

View file

@ -13,13 +13,13 @@
mod circ1 { mod circ1 {
pub use circ2::f2; pub use circ2::f2;
pub fn f1() { println!("f1"); } pub fn f1() { println!("f1"); }
pub fn common() -> usize { return 0us; } pub fn common() -> usize { return 0_usize; }
} }
mod circ2 { mod circ2 {
pub use circ1::f1; pub use circ1::f1;
pub fn f2() { println!("f2"); } pub fn f2() { println!("f2"); }
pub fn common() -> usize { return 1us; } pub fn common() -> usize { return 1_usize; }
} }
mod test { mod test {

View file

@ -9,5 +9,5 @@
// except according to those terms. // except according to those terms.
fn main() { 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
} }

View file

@ -28,11 +28,11 @@ impl<T:Clone> to_opt for Option<T> {
} }
fn function<T:to_opt + Clone>(counter: usize, t: T) { fn function<T:to_opt + Clone>(counter: usize, t: T) {
if counter > 0us { if counter > 0_usize {
function(counter - 1us, t.to_option()); function(counter - 1_usize, t.to_option());
} }
} }
fn main() { fn main() {
function(22us, 22us); function(22_usize, 22_usize);
} }

View file

@ -11,7 +11,7 @@
pub fn main() { pub fn main() {
let v: Vec<isize> = vec!(0, 1, 2, 3, 4, 5); let v: Vec<isize> = vec!(0, 1, 2, 3, 4, 5);
let s: String = "abcdef".to_string(); let s: String = "abcdef".to_string();
v[3us]; v[3_usize];
v[3]; v[3];
v[3u8]; //~ERROR the trait `core::ops::Index<u8>` is not implemented v[3u8]; //~ERROR the trait `core::ops::Index<u8>` is not implemented
//~^ ERROR the trait `core::ops::Index<u8>` is not implemented //~^ ERROR the trait `core::ops::Index<u8>` is not implemented
@ -21,7 +21,7 @@ pub fn main() {
//~^ ERROR the trait `core::ops::Index<u32>` is not implemented //~^ ERROR the trait `core::ops::Index<u32>` is not implemented
v[3i32]; //~ERROR the trait `core::ops::Index<i32>` is not implemented v[3i32]; //~ERROR the trait `core::ops::Index<i32>` is not implemented
//~^ ERROR the trait `core::ops::Index<i32>` is not implemented //~^ ERROR the trait `core::ops::Index<i32>` is not implemented
s.as_bytes()[3us]; s.as_bytes()[3_usize];
s.as_bytes()[3]; s.as_bytes()[3];
s.as_bytes()[3u8]; //~ERROR the trait `core::ops::Index<u8>` is not implemented s.as_bytes()[3u8]; //~ERROR the trait `core::ops::Index<u8>` is not implemented
//~^ERROR the trait `core::ops::Index<u8>` is not implemented //~^ERROR the trait `core::ops::Index<u8>` is not implemented

View file

@ -14,7 +14,7 @@ pub fn main() {
// The expected arm type `Option<T>` has one type parameter, while // The expected arm type `Option<T>` has one type parameter, while
// the actual arm `Result<T, E>` has two. typeck should not be // the actual arm `Result<T, E>` has two. typeck should not be
// tricked into looking up a non-existing second type parameter. // 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, Ok(u) => u,
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected `core::option::Option<usize>` //~| expected `core::option::Option<usize>`

View file

@ -16,7 +16,7 @@ struct Foo {
} }
fn main() { fn main() {
let x = 1us; let x = 1_usize;
let y: Foo; let y: Foo;
// `x { ... }` should not be interpreted as a struct literal here // `x { ... }` should not be interpreted as a struct literal here

View file

@ -11,16 +11,16 @@
#![feature(box_syntax)] #![feature(box_syntax)]
fn main() { fn main() {
let _foo = &[1us, 2] as [usize]; let _foo = &[1_usize, 2] as [usize];
//~^ ERROR cast to unsized type: `&[usize; 2]` as `[usize]` //~^ ERROR cast to unsized type: `&[usize; 2]` as `[usize]`
//~^^ HELP consider using an implicit coercion to `&[usize]` instead //~^^ 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<usize>` as `core::fmt::Show` //~^ ERROR cast to unsized type: `Box<usize>` as `core::fmt::Show`
//~^^ HELP did you mean `Box<core::fmt::Show>`? //~^^ HELP did you mean `Box<core::fmt::Show>`?
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` //~^ ERROR cast to unsized type: `usize` as `core::fmt::Show`
//~^^ HELP consider using a box or reference as appropriate //~^^ 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]` //~^ ERROR cast to unsized type: `[usize; 2]` as `[usize]`
//~^^ HELP consider using a box or reference as appropriate //~^^ HELP consider using a box or reference as appropriate
} }

View file

@ -14,7 +14,7 @@
#![feature(box_syntax)] #![feature(box_syntax)]
fn main() { fn main() {
(|| box *[0us].as_slice())(); (|| box *[0_usize].as_slice())();
//~^ ERROR cannot move out of borrowed content //~^ ERROR cannot move out of borrowed content
//~^^ ERROR cannot move a value of type [usize] //~^^ ERROR cannot move a value of type [usize]
} }

View file

@ -13,7 +13,7 @@ static mut A2: usize = 1;
const A3: usize = 1; const A3: usize = 1;
fn main() { fn main() {
match 1us { match 1_usize {
A1 => {} //~ ERROR: static variables cannot be referenced in a pattern A1 => {} //~ ERROR: static variables cannot be referenced in a pattern
A2 => {} //~ ERROR: static variables cannot be referenced in a pattern A2 => {} //~ ERROR: static variables cannot be referenced in a pattern
A3 => {} A3 => {}

View file

@ -15,14 +15,14 @@
#[cfg(target_pointer_width = "64")] #[cfg(target_pointer_width = "64")]
fn main() { fn main() {
let n = 0us; let n = 0_usize;
let a = box [&n; 0xF000000000000000us]; let a = box [&n; 0xF000000000000000_usize];
println!("{}", a[0xFFFFFFu]); println!("{}", a[0xFFFFFF_usize]);
} }
#[cfg(target_pointer_width = "32")] #[cfg(target_pointer_width = "32")]
fn main() { fn main() {
let n = 0us; let n = 0_usize;
let a = box [&n; 0xFFFFFFFFu]; let a = box [&n; 0xFFFFFFFF_usize];
println!("{}", a[0xFFFFFFu]); println!("{}", a[0xFFFFFF_usize]);
} }

View file

@ -8,10 +8,10 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
pub static X: usize = 1us; pub static X: usize = 1_usize;
fn main() { fn main() {
match 1us { match 1_usize {
self::X => { }, self::X => { },
//~^ ERROR static variables cannot be referenced in a pattern, use a `const` instead //~^ ERROR static variables cannot be referenced in a pattern, use a `const` instead
_ => { }, _ => { },

View file

@ -10,5 +10,5 @@
// error-pattern:no valid digits found for number // error-pattern:no valid digits found for number
fn main() { fn main() {
log(error, 0bu); log(error, 0b_usize);
} }

View file

@ -16,7 +16,7 @@ fn _create_render(_: &()) ->
AbstractRenderer AbstractRenderer
//~^ ERROR: the trait `core::marker::Sized` is not implemented //~^ ERROR: the trait `core::marker::Sized` is not implemented
{ {
match 0us { match 0_usize {
_ => unimplemented!() _ => unimplemented!()
} }
} }

View file

@ -13,5 +13,5 @@ enum Foo {
} }
fn main() { 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
} }

View file

@ -28,7 +28,7 @@ impl Tr for usize {
} }
fn main() { fn main() {
let s = &mut 1us; let s = &mut 1_usize;
MyPtr(s).poke(s); MyPtr(s).poke(s);
//~^ ERROR cannot borrow `*s` as mutable more than once at a time //~^ ERROR cannot borrow `*s` as mutable more than once at a time

View file

@ -13,7 +13,7 @@
use std::cell::RefCell; use std::cell::RefCell;
fn main() { fn main() {
let mut y = 1us; let mut y = 1_usize;
let c = RefCell::new(vec![]); let c = RefCell::new(vec![]);
c.push(box || y = 0); c.push(box || y = 0);
c.push(box || y = 0); c.push(box || y = 0);
@ -21,7 +21,7 @@ fn main() {
} }
fn ufcs() { fn ufcs() {
let mut y = 1us; let mut y = 1_usize;
let c = RefCell::new(vec![]); let c = RefCell::new(vec![]);
Push::push(&c, box || y = 0); Push::push(&c, box || y = 0);

View file

@ -17,7 +17,7 @@ impl Foo for Thing {
fn foo<T>(&self, _: &T) {} fn foo<T>(&self, _: &T) {}
} }
#[inline(never)] fn foo(b: &Bar) { b.foo(&0us) } #[inline(never)] fn foo(b: &Bar) { b.foo(&0_usize) }
fn main() { fn main() {
let mut thing = Thing; let mut thing = Thing;

View file

@ -15,7 +15,7 @@
fn fail_len(v: Vec<isize> ) -> usize { fn fail_len(v: Vec<isize> ) -> usize {
let mut i = 3; let mut i = 3;
panic!(); panic!();
for x in &v { i += 1us; } for x in &v { i += 1_usize; }
//~^ ERROR: unreachable statement //~^ ERROR: unreachable statement
return i; return i;
} }

View file

@ -11,7 +11,7 @@
fn bar(int_param: usize) {} fn bar(int_param: usize) {}
fn main() { fn main() {
let foo: [u8; 4] = [1u8; 4us]; let foo: [u8; 4] = [1u8; 4_usize];
bar(foo); bar(foo);
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected `usize` //~| expected `usize`

View file

@ -9,6 +9,6 @@
// except according to those terms. // except according to those terms.
fn main() { fn main() {
let _i = 18446744073709551616; // 2^64 let __isize = 18446744073709551616; // 2^64
//~^ ERROR int literal is too large //~^ ERROR int literal is too large
} }

View file

@ -9,6 +9,6 @@
// except according to those terms. // except according to those terms.
fn main() { fn main() {
let _i = 0xff_ffff_ffff_ffff_ffff_is; let __isize = 0xff_ffff_ffff_ffff_ffff__isize;
//~^ ERROR int literal is too large //~^ ERROR int literal is too large
} }

View file

@ -30,17 +30,17 @@ trait UnusedTrait {
impl CtxtFn for usize { impl CtxtFn for usize {
fn f8(self, i: usize) -> usize { fn f8(self, i: usize) -> usize {
i * 4us i * 4_usize
} }
fn f9(i: usize) -> usize { fn f9(i: usize) -> usize {
i * 4us i * 4_usize
} }
} }
impl OtherTrait for usize { impl OtherTrait for usize {
fn f9(i: usize) -> usize { fn f9(i: usize) -> usize {
i * 8us i * 8_usize
} }
} }

View file

@ -22,7 +22,7 @@ fn main() {
//~^ ERROR attempted to divide with overflow in a constant expression //~^ ERROR attempted to divide with overflow in a constant expression
assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err()); assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err());
//~^ ERROR attempted to divide with overflow in a constant expression //~^ 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 //~^ ERROR attempted to divide by zero in a constant expression
assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err()); assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err());
//~^ ERROR attempted to divide by zero in a constant expression //~^ 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 //~^ ERROR attempted remainder with overflow in a constant expression
assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err()); assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err());
//~^ ERROR attempted remainder with overflow in a constant expression //~^ 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 //~^ ERROR attempted remainder with a divisor of zero in a constant expression
assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err()); assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err());
//~^ ERROR attempted remainder with a divisor of zero in a constant expression //~^ ERROR attempted remainder with a divisor of zero in a constant expression

View file

@ -9,7 +9,7 @@
// except according to those terms. // except according to those terms.
pub extern pub extern
"invalid-abi" //~ ERROR illegal ABI "invalid-ab_isize" //~ ERROR illegal ABI
fn foo() {} fn foo() {}
fn main() {} fn main() {}

View file

@ -16,7 +16,7 @@ fn foo(_x: Rc<usize>) {}
fn bar<F:FnOnce() + Send>(_: F) { } fn bar<F:FnOnce() + Send>(_: F) { }
fn main() { fn main() {
let x = Rc::new(3us); let x = Rc::new(3_usize);
bar(move|| foo(x)); bar(move|| foo(x));
//~^ ERROR `core::marker::Send` is not implemented //~^ ERROR `core::marker::Send` is not implemented
} }

View file

@ -63,6 +63,6 @@ fn field_match_in_let(f: Bar) -> bool {
fn main() { fn main() {
field_read(Foo { x: 1, b: false, marker: std::marker::NoCopy }); field_read(Foo { x: 1, b: false, marker: std::marker::NoCopy });
field_match_in_patterns(XYZ::Z); 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 }; let _ = Baz { x: 0 };
} }

View file

@ -57,7 +57,7 @@ fn main() {
let n = 1u8 << (4+3); let n = 1u8 << (4+3);
let n = 1u8 << (4+4); //~ ERROR: bitshift exceeds the type's number of bits 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 = 1_isize << 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_usize << std::usize::BITS; //~ ERROR: bitshift exceeds the type's number of bits
} }

View file

@ -15,7 +15,7 @@
#![allow(dead_code)] #![allow(dead_code)]
#![feature(custom_attribute)] #![feature(custom_attribute)]
#[abi="stdcall"] extern {} //~ ERROR unused attribute #[ab_isize="stdcall"] extern {} //~ ERROR unused attribute
#[fixed_stack_segment] fn f() {} //~ ERROR unused attribute #[fixed_stack_segment] fn f() {} //~ ERROR unused attribute

View file

@ -14,7 +14,7 @@
fn main() { } fn main() { }
fn foo() { fn foo() {
let mut i = 100us; let mut i = 100_usize;
while i >= 0 { //~ ERROR comparison is useless due to type limits while i >= 0 { //~ ERROR comparison is useless due to type limits
i -= 1; i -= 1;
} }
@ -50,12 +50,12 @@ fn qux() {
} }
fn quy() { 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 //~^ WARNING unused variable
} }
fn quz() { fn quz() {
let i = 23us; let i = 23_usize;
let j = -i; //~ WARNING negation of unsigned int variable may be unintentional let j = -i; //~ WARNING negation of unsigned int variable may be unintentional
//~^ WARNING unused variable //~^ WARNING unused variable
} }

View file

@ -16,5 +16,5 @@
extern crate macro_non_reexport_2; extern crate macro_non_reexport_2;
fn main() { fn main() {
assert_eq!(reexported!(), 3us); //~ ERROR macro undefined assert_eq!(reexported!(), 3_usize); //~ ERROR macro undefined
} }

View file

@ -18,5 +18,5 @@
extern crate macro_reexport_1; extern crate macro_reexport_1;
fn main() { fn main() {
assert_eq!(reexported!(), 3us); //~ ERROR macro undefined assert_eq!(reexported!(), 3_usize); //~ ERROR macro undefined
} }

View file

@ -10,7 +10,7 @@
fn main() { fn main() {
match 1 { match 1 {
1...2us => 1, //~ ERROR mismatched types in range 1...2_usize => 1, //~ ERROR mismatched types in range
_ => 2, _ => 2,
}; };
} }

View file

@ -18,5 +18,5 @@ trait me2 {
fn me(&self) -> usize; fn me(&self) -> usize;
} }
impl me2 for usize { fn me(&self) -> usize { *self } } impl me2 for usize { fn me(&self) -> usize { *self } }
fn main() { 1us.me(); } //~ ERROR E0034 fn main() { 1_usize.me(); } //~ ERROR E0034

View file

@ -19,5 +19,5 @@ impl Foo for usize {}
impl Bar for usize {} impl Bar for usize {}
fn main() { fn main() {
1us.method(); //~ ERROR E0034 1_usize.method(); //~ ERROR E0034
} }

View file

@ -29,6 +29,6 @@ fn cat(in_x : usize, in_y : isize) -> cat {
} }
fn main() { fn main() {
let nyan : cat = cat(52us, 99); let nyan : cat = cat(52_usize, 99);
nyan.eat(); nyan.eat();
} }

View file

@ -21,6 +21,6 @@ fn cat(in_x : usize, in_y : isize) -> cat {
} }
fn main() { fn main() {
let nyan : cat = cat(52us, 99); let nyan : cat = cat(52_usize, 99);
nyan.how_hungry = 0; //~ ERROR cannot assign nyan.how_hungry = 0; //~ ERROR cannot assign
} }

View file

@ -123,8 +123,8 @@ fn main() {
//~^^^ HELP `no_method_suggested_traits::foo::PubPub` //~^^^ HELP `no_method_suggested_traits::foo::PubPub`
// should have no help: // should have no help:
1us.method3(); //~ ERROR does not implement 1_usize.method3(); //~ ERROR does not implement
std::rc::Rc::new(&mut Box::new(&1us)).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 no_method_suggested_traits::Foo.method3(); //~ ERROR does not implement
std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method3(); std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method3();
//~^ ERROR does not implement //~^ ERROR does not implement

View file

@ -27,7 +27,7 @@ fn struct_with_a_nested_enum_and_vector() {
Foo { first: true, second: None } => (), Foo { first: true, second: None } => (),
Foo { first: true, second: Some(_) } => (), Foo { first: true, second: Some(_) } => (),
Foo { first: false, second: None } => (), 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]) } => ()
} }
} }

View file

@ -12,4 +12,4 @@
enum blah { a(isize, isize, usize), b(isize, isize), } 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) => { } } }

View file

@ -30,6 +30,6 @@ mod kitties {
} }
fn main() { fn main() {
let nyan : kitties::cat = kitties::cat(52us, 99); let nyan : kitties::cat = kitties::cat(52_usize, 99);
nyan.nap(); nyan.nap();
} }

View file

@ -13,7 +13,7 @@ extern crate cci_class;
use cci_class::kitties::cat; use cci_class::kitties::cat;
fn main() { fn main() {
let nyan : cat = cat(52us, 99); let nyan : cat = cat(52_usize, 99);
assert!((nyan.meows == 52us)); assert!((nyan.meows == 52_usize));
//~^ ERROR field `meows` of struct `cci_class::kitties::cat` is private //~^ ERROR field `meows` of struct `cci_class::kitties::cat` is private
} }

View file

@ -15,18 +15,18 @@ struct dog {
impl dog { impl dog {
pub fn chase_cat(&mut self) { pub fn chase_cat(&mut self) {
let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer
*p += 1us; *p += 1_usize;
} }
pub fn chase_cat_2(&mut self) { pub fn chase_cat_2(&mut self) {
let p: &mut usize = &mut self.cats_chased; let p: &mut usize = &mut self.cats_chased;
*p += 1us; *p += 1_usize;
} }
} }
fn dog() -> dog { fn dog() -> dog {
dog { dog {
cats_chased: 0us cats_chased: 0_usize
} }
} }

View file

@ -18,7 +18,7 @@ impl dog {
pub fn chase_cat(&mut self) { pub fn chase_cat(&mut self) {
let _f = || { let _f = || {
let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer
*p = 3us; *p = 3_usize;
}; };
} }
} }

View file

@ -14,8 +14,8 @@ enum ast<'a> {
} }
fn build() { fn build() {
let x = ast::num(3us); let x = ast::num(3_usize);
let y = ast::num(4us); let y = ast::num(4_usize);
let z = ast::add(&x, &y); let z = ast::add(&x, &y);
compute(&z); compute(&z);
} }

View file

@ -14,12 +14,12 @@ struct invariant<'a> {
marker: marker::InvariantLifetime<'a> marker: marker::InvariantLifetime<'a>
} }
fn to_same_lifetime<'r>(bi: invariant<'r>) { fn to_same_lifetime<'r>(b_isize: invariant<'r>) {
let bj: invariant<'r> = bi; let bj: invariant<'r> = b_isize;
} }
fn to_longer_lifetime<'r>(bi: invariant<'r>) -> invariant<'static> { fn to_longer_lifetime<'r>(b_isize: invariant<'r>) -> invariant<'static> {
bi //~ ERROR mismatched types b_isize //~ ERROR mismatched types
} }
fn main() { fn main() {

View file

@ -13,12 +13,12 @@ struct invariant<'a> {
f: Box<FnOnce(&mut &'a isize) + 'static>, f: Box<FnOnce(&mut &'a isize) + 'static>,
} }
fn to_same_lifetime<'r>(bi: invariant<'r>) { fn to_same_lifetime<'r>(b_isize: invariant<'r>) {
let bj: invariant<'r> = bi; let bj: invariant<'r> = b_isize;
} }
fn to_longer_lifetime<'r>(bi: invariant<'r>) -> invariant<'static> { fn to_longer_lifetime<'r>(b_isize: invariant<'r>) -> invariant<'static> {
bi //~ ERROR mismatched types b_isize //~ ERROR mismatched types
} }
fn main() { fn main() {

View file

@ -13,12 +13,12 @@ struct Invariant<'a> {
f: Box<for<'b> FnOnce() -> &'b mut &'a isize + 'static>, f: Box<for<'b> FnOnce() -> &'b mut &'a isize + 'static>,
} }
fn to_same_lifetime<'r>(bi: Invariant<'r>) { fn to_same_lifetime<'r>(b_isize: Invariant<'r>) {
let bj: Invariant<'r> = bi; let bj: Invariant<'r> = b_isize;
} }
fn to_longer_lifetime<'r>(bi: Invariant<'r>) -> Invariant<'static> { fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {
bi //~ ERROR mismatched types b_isize //~ ERROR mismatched types
} }
fn main() { fn main() {

View file

@ -15,7 +15,7 @@
fn main() { fn main() {
// Unboxed closure case // Unboxed closure case
{ {
let mut x = 0us; let mut x = 0_usize;
let mut f = || &mut x; //~ ERROR cannot infer let mut f = || &mut x; //~ ERROR cannot infer
let x = f(); let x = f();
let y = f(); let y = f();

View file

@ -34,7 +34,7 @@ fn get_v(gc: Box<get_ctxt>) -> usize {
} }
fn main() { fn main() {
let ctxt = ctxt { v: 22us }; let ctxt = ctxt { v: 22_usize };
let hc = has_ctxt { c: &ctxt }; let hc = has_ctxt { c: &ctxt };
assert_eq!(get_v(box hc as Box<get_ctxt>), 22us); assert_eq!(get_v(box hc as Box<get_ctxt>), 22_usize);
} }

View file

@ -41,14 +41,14 @@ fn main() {
//~| expected usize //~| expected usize
//~| found &-ptr //~| found &-ptr
//~| ERROR expected positive integer for repeat count, found string //~| ERROR expected positive integer for repeat count, found string
let f = [0; -4is]; let f = [0; -4_isize];
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected `usize` //~| expected `usize`
//~| found `isize` //~| found `isize`
//~| expected usize //~| expected usize
//~| found isize //~| found isize
//~| ERROR expected positive integer for repeat count, found negative integer //~| ERROR expected positive integer for repeat count, found negative integer
let f = [0us; -1is]; let f = [0_usize; -1_isize];
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected `usize` //~| expected `usize`
//~| found `isize` //~| found `isize`

View file

@ -39,5 +39,5 @@ fn main() {
// just to ensure that this test fails to compile; when shadowed // just to ensure that this test fails to compile; when shadowed
// lifetimes become either an error or a proper lint, this will // lifetimes become either an error or a proper lint, this will
// not be needed. // not be needed.
let x: isize = 3us; //~ ERROR mismatched types let x: isize = 3_usize; //~ ERROR mismatched types
} }

View file

@ -30,7 +30,7 @@ fn main() {
//~| found `Bar` //~| found `Bar`
//~| expected struct `Foo` //~| expected struct `Foo`
//~| found struct `Bar` //~| 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` //~| expected `Foo`
//~| found `_` //~| found `_`
//~| expected struct `Foo` //~| expected struct `Foo`

View file

@ -12,6 +12,6 @@
fn f() -> isize { return g(); } fn f() -> isize { return g(); }
fn g() -> usize { return 0us; } fn g() -> usize { return 0_usize; }
fn main() { let y = f(); } fn main() { let y = f(); }

View file

@ -22,28 +22,28 @@ fn to_fn_once<A,F:FnOnce<A>>(f: F) -> F { f }
fn main() { fn main() {
// By-ref cases // By-ref cases
{ {
let x = box 0us; let x = box 0_usize;
let f = to_fn(|| drop(x)); //~ ERROR cannot move 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 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 let f = to_fn_once(|| drop(x)); // OK -- FnOnce
} }
// By-value cases // By-value cases
{ {
let x = box 0us; let x = box 0_usize;
let f = to_fn(move || drop(x)); //~ ERROR cannot move 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 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 let f = to_fn_once(move || drop(x)); // this one is ok
} }
} }

View file

@ -17,7 +17,7 @@
fn set(x: &mut usize) { *x = 0; } fn set(x: &mut usize) { *x = 0; }
fn main() { fn main() {
let x = 0us; let x = 0_usize;
move || x = 1; //~ ERROR cannot assign move || x = 1; //~ ERROR cannot assign
move || set(&mut x); //~ ERROR cannot borrow move || set(&mut x); //~ ERROR cannot borrow
move || x = 1; //~ ERROR cannot assign move || x = 1; //~ ERROR cannot assign

View file

@ -14,7 +14,7 @@
// reference cannot escape the region of that variable. // reference cannot escape the region of that variable.
fn main() { fn main() {
let _f = { let _f = {
let x = 0us; let x = 0_usize;
|| x //~ ERROR cannot infer an appropriate lifetime due to conflicting requirements || x //~ ERROR cannot infer an appropriate lifetime due to conflicting requirements
}; };
} }

View file

@ -14,7 +14,7 @@
// cause borrow conflicts. // cause borrow conflicts.
fn main() { fn main() {
let mut x = 0us; let mut x = 0_usize;
let f = || x += 1; let f = || x += 1;
let _y = x; //~ ERROR cannot use `x` because it was mutably borrowed let _y = x; //~ ERROR cannot use `x` because it was mutably borrowed
} }

View file

@ -14,6 +14,6 @@ use std::ops::FnMut;
pub fn main() { pub fn main() {
let mut f = |x: isize, y: isize| -> isize { x + y }; 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); println!("{}", z);
} }

View file

@ -12,7 +12,7 @@
use std::rc::Rc; use std::rc::Rc;
fn f<T:Send>(_i: T) { fn f<T:Send>(__isize: T) {
} }
fn main() { fn main() {

View file

@ -28,7 +28,7 @@ impl<'a> Drop for r<'a> {
} }
} }
fn f<T>(_i: Vec<T> , _j: Vec<T> ) { fn f<T>(__isize: Vec<T> , _j: Vec<T> ) {
} }
fn clone<T: Clone>(t: &T) -> T { t.clone() } fn clone<T: Clone>(t: &T) -> T { t.clone() }

View file

@ -15,4 +15,4 @@
enum foo { a(Box<foo>, isize), b(usize), } enum foo { a(Box<foo>, 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) => { } } }

View file

@ -23,7 +23,7 @@ impl TraitB for isize {
} }
fn call_it<B:TraitB>(b: B) -> isize { fn call_it<B:TraitB>(b: B) -> isize {
let y = 4us; let y = 4_usize;
b.gimme_an_a(y) //~ ERROR the trait `TraitA` is not implemented b.gimme_an_a(y) //~ ERROR the trait `TraitA` is not implemented
} }

View file

@ -10,4 +10,4 @@
// error-pattern:quux // error-pattern:quux
fn my_err(s: String) -> ! { println!("{}", s); panic!("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()); }

View file

@ -14,14 +14,14 @@
use std::uint; use std::uint;
fn main() { 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 // 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 // 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 // length (in bytes), because the scaling of the index will cause it to
// wrap around to a small number. // 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); println!("ov2 idx = 0x%x", idx);
// This should panic. // This should panic.

View file

@ -15,7 +15,7 @@ use std::u64;
#[cfg(target_arch="x86")] #[cfg(target_arch="x86")]
fn main() { 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 // 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 // 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. // 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", println!("ov3 idx = 0x%8.8x%8.8x",
(idx >> 32) as uint, (idx >> 32) as uint,
idx as uint); idx as uint);
@ -35,6 +35,6 @@ fn main() {
#[cfg(any(target_arch="x86_64", target_arch = "aarch64"))] #[cfg(any(target_arch="x86_64", target_arch = "aarch64"))]
fn main() { fn main() {
// This version just panics anyways, for symmetry on 64-bit hosts. // 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]); error!("ov3 0x%x", x[200]);
} }

View file

@ -20,7 +20,7 @@ fn main() {
// address of the 0th cell in the array (even though the index is // address of the 0th cell in the array (even though the index is
// huge). // huge).
let x = vec!(1u,2u,3u); let x = vec!(1_usize,2_usize,3_usize);
let base = x.as_ptr() as uint; let base = x.as_ptr() as uint;
let idx = base / mem::size_of::<uint>(); let idx = base / mem::size_of::<uint>();

View file

@ -11,5 +11,5 @@
// error-pattern:test // error-pattern:test
fn main() { fn main() {
let _i: int = panic!("test"); let __isize: int = panic!("test");
} }

View file

@ -26,10 +26,10 @@ mod rustrt {
} }
extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t { extern fn cb(data: libc::uintptr_t) -> libc::uintptr_t {
if data == 1u { if data == 1_usize {
data data
} else { } 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() { fn main() {
for _ in 0..10u { for _ in 0..10_usize {
task::spawn(move|| { task::spawn(move|| {
let result = count(5u); let result = count(5_usize);
println!("result = %?", result); println!("result = %?", result);
panic!(); panic!();
}); });

View file

@ -10,4 +10,4 @@
// error-pattern:moop // error-pattern:moop
fn main() { for _ in 0u..10u { panic!("moop"); } } fn main() { for _ in 0_usize..10_usize { panic!("moop"); } }

View file

@ -10,9 +10,9 @@
// error-pattern:Number is odd // error-pattern:Number is odd
fn even(x: uint) -> bool { fn even(x: uint) -> bool {
if x < 2u { if x < 2_usize {
return false; 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) { fn foo(x: uint) {
@ -23,4 +23,4 @@ fn foo(x: uint) {
} }
} }
fn main() { foo(3u); } fn main() { foo(3_usize); }

View file

@ -1,17 +1,17 @@
digraph block { digraph block {
N0[label="entry"]; N0[label="entry"];
N1[label="exit"]; N1[label="exit"];
N2[label="expr 2us"]; N2[label="expr 2usize"];
N3[label="expr 0us"]; N3[label="expr 0usize"];
N4[label="expr 20us"]; N4[label="expr 20usize"];
N5[label="expr [2us, 0us, 20us]"]; N5[label="expr [2usize, 0usize, 20usize]"];
N6[label="local v"]; N6[label="local v"];
N7[label="stmt let v = [2us, 0us, 20us];"]; N7[label="stmt let v = [2usize, 0usize, 20usize];"];
N8[label="expr v"]; N8[label="expr v"];
N9[label="expr 20us"]; N9[label="expr 20usize"];
N10[label="expr v[20us]"]; N10[label="expr v[20usize]"];
N11[label="stmt v[20us];"]; N11[label="stmt v[20usize];"];
N12[label="block { let v = [2us, 0us, 20us]; v[20us]; }"]; N12[label="block { let v = [2usize, 0usize, 20usize]; v[20usize]; }"];
N0 -> N2; N0 -> N2;
N2 -> N3; N2 -> N3;
N3 -> N4; N3 -> N4;

Some files were not shown because too many files have changed in this diff Show more