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 {
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 }
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

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

View File

@ -12,10 +12,10 @@
#[inline]
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();
while i < n {
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
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();
while i < n {
f(v[i]);
i += 1u;
i += 1_usize;
}
}

View File

@ -11,5 +11,5 @@
#![crate_type = "dylib"]
#[macro_export]
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 total = 0u;
let mut total = 0_usize;
while !text.is_empty() {
match NUMERALS.iter().find(|&&(rn, _)| text.starts_with(rn)) {
Some(&(rn, val)) => {

View File

@ -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()
}

View File

@ -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;
}

View File

@ -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
}
}

View File

@ -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);

View File

@ -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
}

View File

@ -10,5 +10,5 @@
fn main() {
#[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
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); }

View File

@ -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); }

View File

@ -9,7 +9,7 @@
// except according to those terms.
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 {

View File

@ -21,25 +21,25 @@ fn to_fn_mut<A,F:FnMut<A>>(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
}
}

View File

@ -56,15 +56,15 @@ impl Point {
}
fn deref_imm_field(x: Own<Point>) {
let _i = &x.y;
let __isize = &x.y;
}
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>) {
let _i = &mut x.y;
let __isize = &mut x.y;
}
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.
/*
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>) {
let _i = &x.y;
let __isize = &x.y;
}
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>) {
let _i = &mut x.y; //~ ERROR cannot borrow
let __isize = &mut x.y; //~ ERROR cannot borrow
}
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>) {
let _i = x.get();
let __isize = x.get();
}
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>) {
let _i = &*x;
let __isize = &*x;
}
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>) {
let _i = &mut *x;
let __isize = &mut *x;
}
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>) {
let _i = &*x;
let __isize = &*x;
}
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>) {
let _i = &mut *x; //~ ERROR cannot borrow
let __isize = &mut *x; //~ ERROR cannot borrow
}
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!
x = Some(0);
}
Some(ref _i) => {
Some(ref __isize) => {
x = Some(1); //~ ERROR cannot assign
}
}

View File

@ -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
};

View File

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

View File

@ -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
}

View File

@ -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() {

View File

@ -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 { }

View File

@ -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;
}
}

View File

@ -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 {

View File

@ -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
}

View File

@ -28,11 +28,11 @@ impl<T:Clone> to_opt for Option<T> {
}
fn function<T:to_opt + Clone>(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);
}

View File

@ -11,7 +11,7 @@
pub fn main() {
let v: Vec<isize> = 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<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
v[3i32]; //~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()[3u8]; //~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 actual arm `Result<T, E>` 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<usize>`

View File

@ -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

View File

@ -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<usize>` as `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`
//~^^ 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
}

View File

@ -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]
}

View File

@ -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 => {}

View File

@ -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]);
}

View File

@ -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
_ => { },

View File

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

View File

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

View File

@ -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
}

View File

@ -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

View File

@ -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);

View File

@ -17,7 +17,7 @@ impl Foo for Thing {
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() {
let mut thing = Thing;

View File

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

View File

@ -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`

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}
}

View File

@ -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

View File

@ -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() {}

View File

@ -16,7 +16,7 @@ fn foo(_x: Rc<usize>) {}
fn bar<F:FnOnce() + Send>(_: 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
}

View File

@ -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 };
}

View File

@ -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
}

View File

@ -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

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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,
};
}

View File

@ -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

View File

@ -19,5 +19,5 @@ impl Foo for usize {}
impl Bar for usize {}
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() {
let nyan : cat = cat(52us, 99);
let nyan : cat = cat(52_usize, 99);
nyan.eat();
}

View File

@ -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
}

View File

@ -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

View File

@ -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]) } => ()
}
}

View File

@ -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) => { } } }

View File

@ -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();
}

View File

@ -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
}

View File

@ -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
}
}

View File

@ -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;
};
}
}

View File

@ -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);
}

View File

@ -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() {

View File

@ -13,12 +13,12 @@ struct invariant<'a> {
f: Box<FnOnce(&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() {

View File

@ -13,12 +13,12 @@ struct Invariant<'a> {
f: Box<for<'b> 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() {

View File

@ -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();

View File

@ -34,7 +34,7 @@ fn get_v(gc: Box<get_ctxt>) -> 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<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
//~| 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`

View File

@ -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
}

View File

@ -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`

View File

@ -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(); }

View File

@ -22,28 +22,28 @@ fn to_fn_once<A,F:FnOnce<A>>(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
}
}

View File

@ -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

View File

@ -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
};
}

View File

@ -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
}

View File

@ -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);
}

View File

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

View File

@ -15,4 +15,4 @@
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 {
let y = 4us;
let y = 4_usize;
b.gimme_an_a(y) //~ ERROR the trait `TraitA` is not implemented
}

View File

@ -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()); }

View File

@ -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.

View File

@ -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]);
}

View File

@ -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::<uint>();

View File

@ -11,5 +11,5 @@
// error-pattern:test
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 {
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!();
});

View File

@ -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"); } }

View File

@ -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); }

View File

@ -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;

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