diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2015-01-08 22:02:42 +1100 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2015-01-08 11:02:24 -0500 |
| commit | 85f961e2ccf056965fd7a95c44ce0922a865ae8d (patch) | |
| tree | 35a4eba610197d3b0442914440963dab9200fdd1 /src | |
| parent | 0c70ce1424f380360dcc8d857c68d2df1a27b6fd (diff) | |
| download | rust-85f961e2ccf056965fd7a95c44ce0922a865ae8d.tar.gz rust-85f961e2ccf056965fd7a95c44ce0922a865ae8d.zip | |
Update compile fail tests to use usize.
Diffstat (limited to 'src')
162 files changed, 325 insertions, 325 deletions
diff --git a/src/test/compile-fail/assign-to-method.rs b/src/test/compile-fail/assign-to-method.rs index f8108519492..047e3325666 100644 --- a/src/test/compile-fail/assign-to-method.rs +++ b/src/test/compile-fail/assign-to-method.rs @@ -9,7 +9,7 @@ // except according to those terms. struct cat { - meows : uint, + meows : usize, how_hungry : isize, } @@ -18,7 +18,7 @@ impl cat { pub fn speak(&self) { self.meows += 1u; } } -fn cat(in_x : uint, in_y : isize) -> cat { +fn cat(in_x : usize, in_y : isize) -> cat { cat { meows: in_x, how_hungry: in_y diff --git a/src/test/compile-fail/associated-types-eq-2.rs b/src/test/compile-fail/associated-types-eq-2.rs index 34c7a6eaa6c..755a9f2d73f 100644 --- a/src/test/compile-fail/associated-types-eq-2.rs +++ b/src/test/compile-fail/associated-types-eq-2.rs @@ -19,8 +19,8 @@ pub trait Foo { struct Bar; impl Foo for isize { - type A = uint; - fn boo(&self) -> uint { 42 } + type A = usize; + fn boo(&self) -> usize { 42 } } fn baz<I: Foo>(x: &<I as Foo<A=Bar>>::A) {} diff --git a/src/test/compile-fail/associated-types-eq-3.rs b/src/test/compile-fail/associated-types-eq-3.rs index f04698100fc..037f5037888 100644 --- a/src/test/compile-fail/associated-types-eq-3.rs +++ b/src/test/compile-fail/associated-types-eq-3.rs @@ -19,8 +19,8 @@ pub trait Foo { struct Bar; impl Foo for isize { - type A = uint; - fn boo(&self) -> uint { + type A = usize; + fn boo(&self) -> usize { 42 } } diff --git a/src/test/compile-fail/associated-types-eq-expr-path.rs b/src/test/compile-fail/associated-types-eq-expr-path.rs index 90c4c97b5bd..9baa7f1ad5a 100644 --- a/src/test/compile-fail/associated-types-eq-expr-path.rs +++ b/src/test/compile-fail/associated-types-eq-expr-path.rs @@ -16,11 +16,11 @@ trait Foo { } impl Foo for isize { - type A = uint; + type A = usize; fn bar() -> isize { 42 } } pub fn main() { - let x: isize = Foo::<A=uint>::bar(); + let x: isize = Foo::<A=usize>::bar(); //~^ERROR unexpected binding of associated item in expression path } diff --git a/src/test/compile-fail/associated-types-eq-hr.rs b/src/test/compile-fail/associated-types-eq-hr.rs index c180e2f6112..d5678c155fd 100644 --- a/src/test/compile-fail/associated-types-eq-hr.rs +++ b/src/test/compile-fail/associated-types-eq-hr.rs @@ -33,9 +33,9 @@ struct UintStruct { } impl<'a> TheTrait<&'a isize> for UintStruct { - type A = &'a uint; + type A = &'a usize; - fn get(&self, t: &'a isize) -> &'a uint { + fn get(&self, t: &'a isize) -> &'a usize { panic!() } } @@ -47,7 +47,7 @@ fn foo<T>() } fn bar<T>() - where T : for<'x> TheTrait<&'x isize, A = &'x uint> + where T : for<'x> TheTrait<&'x isize, A = &'x usize> { // ok for UintStruct, but not IntStruct } diff --git a/src/test/compile-fail/associated-types-incomplete-object.rs b/src/test/compile-fail/associated-types-incomplete-object.rs index 898403f1d61..30923f09127 100644 --- a/src/test/compile-fail/associated-types-incomplete-object.rs +++ b/src/test/compile-fail/associated-types-incomplete-object.rs @@ -20,17 +20,17 @@ pub trait Foo { struct Bar; impl Foo for isize { - type A = uint; + type A = usize; type B = char; - fn boo(&self) -> uint { + fn boo(&self) -> usize { 42 } } pub fn main() { - let a = &42i as &Foo<A=uint, B=char>; + let a = &42i as &Foo<A=usize, B=char>; - let b = &42i as &Foo<A=uint>; + let b = &42i as &Foo<A=usize>; //~^ ERROR the value of the associated type `B` (from the trait `Foo`) must be specified let c = &42i as &Foo<B=char>; diff --git a/src/test/compile-fail/associated-types-path-2.rs b/src/test/compile-fail/associated-types-path-2.rs index 4a9e0777697..74c8dffced5 100644 --- a/src/test/compile-fail/associated-types-path-2.rs +++ b/src/test/compile-fail/associated-types-path-2.rs @@ -15,7 +15,7 @@ pub trait Foo { } impl Foo for isize { - type A = uint; + type A = usize; } pub fn f1<T: Foo>(a: T, x: T::A) {} diff --git a/src/test/compile-fail/associated-types-unconstrained.rs b/src/test/compile-fail/associated-types-unconstrained.rs index 8b80ab92e07..aecbf217a5b 100644 --- a/src/test/compile-fail/associated-types-unconstrained.rs +++ b/src/test/compile-fail/associated-types-unconstrained.rs @@ -16,7 +16,7 @@ trait Foo { } impl Foo for isize { - type A = uint; + type A = usize; fn bar() -> isize { 42 } } diff --git a/src/test/compile-fail/bad-bang-ann-3.rs b/src/test/compile-fail/bad-bang-ann-3.rs index d204c8c750a..e364d0283c4 100644 --- a/src/test/compile-fail/bad-bang-ann-3.rs +++ b/src/test/compile-fail/bad-bang-ann-3.rs @@ -10,7 +10,7 @@ // Tests that a function with a ! annotation always actually fails -fn bad_bang(i: uint) -> ! { +fn bad_bang(i: usize) -> ! { return 7u; //~ ERROR `return` in a function declared as diverging [E0166] } diff --git a/src/test/compile-fail/bad-bang-ann.rs b/src/test/compile-fail/bad-bang-ann.rs index 7e8142dbb29..817b107d814 100644 --- a/src/test/compile-fail/bad-bang-ann.rs +++ b/src/test/compile-fail/bad-bang-ann.rs @@ -10,7 +10,7 @@ // Tests that a function with a ! annotation always actually fails -fn bad_bang(i: uint) -> ! { //~ 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 < 0u { } else { panic!(); } } diff --git a/src/test/compile-fail/bad-method-typaram-kind.rs b/src/test/compile-fail/bad-method-typaram-kind.rs index 349c33a30a5..636c881a3e1 100644 --- a/src/test/compile-fail/bad-method-typaram-kind.rs +++ b/src/test/compile-fail/bad-method-typaram-kind.rs @@ -16,7 +16,7 @@ trait bar { fn bar<T:Send>(&self); } -impl bar for uint { +impl bar for usize { fn bar<T:Send>(&self) { } } diff --git a/src/test/compile-fail/borrow-immutable-upvar-mutation.rs b/src/test/compile-fail/borrow-immutable-upvar-mutation.rs index f748c400654..228b07555f2 100644 --- a/src/test/compile-fail/borrow-immutable-upvar-mutation.rs +++ b/src/test/compile-fail/borrow-immutable-upvar-mutation.rs @@ -13,7 +13,7 @@ // Tests that we can't assign to or mutably borrow upvars from `Fn` // closures (issue #17780) -fn set(x: &mut uint) { *x = 5; } +fn set(x: &mut usize) { *x = 5; } fn main() { // By-ref captures diff --git a/src/test/compile-fail/borrowck-anon-fields-struct.rs b/src/test/compile-fail/borrowck-anon-fields-struct.rs index 514dd584c6a..5ee2b89dd98 100644 --- a/src/test/compile-fail/borrowck-anon-fields-struct.rs +++ b/src/test/compile-fail/borrowck-anon-fields-struct.rs @@ -11,7 +11,7 @@ // Tests that we are able to distinguish when loans borrow different // anonymous fields of a tuple vs the same anonymous field. -struct Y(uint, uint); +struct Y(usize, usize); fn distinct_variant() { let mut y = Y(1, 2); diff --git a/src/test/compile-fail/borrowck-anon-fields-variant.rs b/src/test/compile-fail/borrowck-anon-fields-variant.rs index 8b54f146d04..4e1b85283a6 100644 --- a/src/test/compile-fail/borrowck-anon-fields-variant.rs +++ b/src/test/compile-fail/borrowck-anon-fields-variant.rs @@ -12,7 +12,7 @@ // anonymous fields of an enum variant vs the same anonymous field. enum Foo { - X, Y(uint, uint) + X, Y(usize, usize) } fn distinct_variant() { diff --git a/src/test/compile-fail/borrowck-autoref-3261.rs b/src/test/compile-fail/borrowck-autoref-3261.rs index 2804b8c48a7..d5f09305808 100644 --- a/src/test/compile-fail/borrowck-autoref-3261.rs +++ b/src/test/compile-fail/borrowck-autoref-3261.rs @@ -10,10 +10,10 @@ enum Either<T, U> { Left(T), Right(U) } -struct X(Either<(uint,uint), fn()>); +struct X(Either<(usize,usize), fn()>); impl X { - pub fn with<F>(&self, blk: F) where F: FnOnce(&Either<(uint, uint), fn()>) { + pub fn with<F>(&self, blk: F) where F: FnOnce(&Either<(usize, usize), fn()>) { let X(ref e) = *self; blk(e) } diff --git a/src/test/compile-fail/borrowck-bad-nested-calls-free.rs b/src/test/compile-fail/borrowck-bad-nested-calls-free.rs index 5a7788ed855..4d1939be5b9 100644 --- a/src/test/compile-fail/borrowck-bad-nested-calls-free.rs +++ b/src/test/compile-fail/borrowck-bad-nested-calls-free.rs @@ -13,12 +13,12 @@ #![feature(box_syntax)] -fn rewrite(v: &mut Box<uint>) -> uint { +fn rewrite(v: &mut Box<usize>) -> usize { *v = box 22; **v } -fn add(v: &uint, w: uint) -> uint { +fn add(v: &usize, w: usize) -> usize { *v + w } diff --git a/src/test/compile-fail/borrowck-bad-nested-calls-move.rs b/src/test/compile-fail/borrowck-bad-nested-calls-move.rs index 263b7f9576b..9eda3689334 100644 --- a/src/test/compile-fail/borrowck-bad-nested-calls-move.rs +++ b/src/test/compile-fail/borrowck-bad-nested-calls-move.rs @@ -13,12 +13,12 @@ #![feature(box_syntax)] -fn rewrite(v: &mut Box<uint>) -> uint { +fn rewrite(v: &mut Box<usize>) -> usize { *v = box 22; **v } -fn add(v: &uint, w: Box<uint>) -> uint { +fn add(v: &usize, w: Box<usize>) -> usize { *v + *w } diff --git a/src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs b/src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs index 04ad583a2db..98d1905ed90 100644 --- a/src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs +++ b/src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs @@ -16,7 +16,7 @@ extern crate collections; use std::collections::HashMap; fn main() { - let mut buggy_map: HashMap<uint, &uint> = HashMap::new(); + let mut buggy_map: HashMap<usize, &usize> = HashMap::new(); buggy_map.insert(42, &*box 1); //~ ERROR borrowed value does not live long enough // but it is ok if we use a temporary diff --git a/src/test/compile-fail/borrowck-lend-flow-loop.rs b/src/test/compile-fail/borrowck-lend-flow-loop.rs index 83fddcf6964..00dba3856a2 100644 --- a/src/test/compile-fail/borrowck-lend-flow-loop.rs +++ b/src/test/compile-fail/borrowck-lend-flow-loop.rs @@ -113,8 +113,8 @@ fn while_aliased_mut_cond(cond: bool, cond2: bool) { } } -fn loop_break_pops_scopes<'r, F>(_v: &'r mut [uint], mut f: F) where - F: FnMut(&'r mut uint) -> bool, +fn loop_break_pops_scopes<'r, F>(_v: &'r mut [usize], mut f: F) where + F: FnMut(&'r mut usize) -> bool, { // Here we check that when you break out of an inner loop, the // borrows that go out of scope as you exit the inner loop are @@ -123,7 +123,7 @@ fn loop_break_pops_scopes<'r, F>(_v: &'r mut [uint], mut f: F) where while cond() { while cond() { // this borrow is limited to the scope of `r`... - let r: &'r mut uint = produce(); + let r: &'r mut usize = produce(); if !f(&mut *r) { break; // ...so it is not live as exit the `while` loop here } @@ -131,13 +131,13 @@ fn loop_break_pops_scopes<'r, F>(_v: &'r mut [uint], mut f: F) where } } -fn loop_loop_pops_scopes<'r, F>(_v: &'r mut [uint], mut f: F) where F: FnMut(&'r mut uint) -> bool { +fn loop_loop_pops_scopes<'r, F>(_v: &'r mut [usize], mut f: F) where F: FnMut(&'r mut usize) -> bool { // Similar to `loop_break_pops_scopes` but for the `loop` keyword while cond() { while cond() { // this borrow is limited to the scope of `r`... - let r: &'r mut uint = produce(); + let r: &'r mut usize = produce(); if !f(&mut *r) { continue; // ...so it is not live as exit (and re-enter) the `while` loop here } diff --git a/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs b/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs index d955e8984bf..902762f687e 100644 --- a/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs +++ b/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs @@ -13,7 +13,7 @@ use std::ops::Add; #[derive(Clone)] -struct foo(Box<uint>); +struct foo(Box<usize>); impl Add for foo { type Output = foo; diff --git a/src/test/compile-fail/borrowck-overloaded-call.rs b/src/test/compile-fail/borrowck-overloaded-call.rs index de959521514..7d35a27c0ae 100644 --- a/src/test/compile-fail/borrowck-overloaded-call.rs +++ b/src/test/compile-fail/borrowck-overloaded-call.rs @@ -38,8 +38,8 @@ struct SFnOnce { x: String, } -impl FnOnce<(String,),uint> for SFnOnce { - extern "rust-call" fn call_once(self, (z,): (String,)) -> uint { +impl FnOnce<(String,),usize> for SFnOnce { + extern "rust-call" fn call_once(self, (z,): (String,)) -> usize { self.x.len() + z.len() } } diff --git a/src/test/compile-fail/borrowck-overloaded-index-2.rs b/src/test/compile-fail/borrowck-overloaded-index-2.rs index 5e6d235574e..bfdd46345de 100644 --- a/src/test/compile-fail/borrowck-overloaded-index-2.rs +++ b/src/test/compile-fail/borrowck-overloaded-index-2.rs @@ -16,10 +16,10 @@ struct MyVec<T> { data: Vec<T>, } -impl<T> Index<uint> for MyVec<T> { +impl<T> Index<usize> for MyVec<T> { type Output = T; - fn index(&self, &i: &uint) -> &T { + fn index(&self, &i: &usize) -> &T { &self.data[i] } } diff --git a/src/test/compile-fail/class-cast-to-trait.rs b/src/test/compile-fail/class-cast-to-trait.rs index c64112d5dfd..31e09e877c7 100644 --- a/src/test/compile-fail/class-cast-to-trait.rs +++ b/src/test/compile-fail/class-cast-to-trait.rs @@ -15,7 +15,7 @@ trait noisy { } struct cat { - meows : uint, + meows : usize, how_hungry : isize, name : String, @@ -50,7 +50,7 @@ impl cat { } } -fn cat(in_x : uint, in_y : isize, in_name: String) -> cat { +fn cat(in_x : usize, in_y : isize, in_name: String) -> cat { cat { meows: in_x, how_hungry: in_y, diff --git a/src/test/compile-fail/class-implements-bad-trait.rs b/src/test/compile-fail/class-implements-bad-trait.rs index 9e7366a643d..8d573806308 100644 --- a/src/test/compile-fail/class-implements-bad-trait.rs +++ b/src/test/compile-fail/class-implements-bad-trait.rs @@ -10,8 +10,8 @@ // error-pattern:nonexistent class cat : nonexistent { - let meows: uint; - new(in_x : uint) { self.meows = in_x; } + let meows: usize; + new(in_x : usize) { self.meows = in_x; } } fn main() { diff --git a/src/test/compile-fail/class-method-missing.rs b/src/test/compile-fail/class-method-missing.rs index 17cf36b73f6..56b3caf6d21 100644 --- a/src/test/compile-fail/class-method-missing.rs +++ b/src/test/compile-fail/class-method-missing.rs @@ -13,14 +13,14 @@ trait animal { } struct cat { - meows: uint, + meows: usize, } impl animal for cat { //~^ ERROR not all trait items implemented, missing: `eat` } -fn cat(in_x : uint) -> cat { +fn cat(in_x : usize) -> cat { cat { meows: in_x } diff --git a/src/test/compile-fail/class-missing-self.rs b/src/test/compile-fail/class-missing-self.rs index 0e75e702277..af172cd4924 100644 --- a/src/test/compile-fail/class-missing-self.rs +++ b/src/test/compile-fail/class-missing-self.rs @@ -9,7 +9,7 @@ // except according to those terms. struct cat { - meows : uint, + meows : usize, } impl cat { diff --git a/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-implemented.rs b/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-implemented.rs index 1372d9930ee..27d97d18c94 100644 --- a/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-implemented.rs +++ b/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-implemented.rs @@ -16,7 +16,7 @@ use std::default::Default; // for the same type (though this crate doesn't). trait MyTrait { - fn get(&self) -> uint; + fn get(&self) -> usize; } trait Even { } @@ -25,14 +25,14 @@ trait Odd { } impl Even for isize { } -impl Odd for uint { } +impl Odd for usize { } impl<T:Even> MyTrait for T { //~ ERROR E0119 - fn get(&self) -> uint { 0 } + fn get(&self) -> usize { 0 } } impl<T:Odd> MyTrait for T { - fn get(&self) -> uint { 0 } + fn get(&self) -> usize { 0 } } fn main() { } diff --git a/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-unimplemented.rs b/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-unimplemented.rs index c44844bcf0b..0f233b78c72 100644 --- a/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-unimplemented.rs +++ b/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-unimplemented.rs @@ -16,7 +16,7 @@ use std::default::Default; // for the same type (though this crate doesn't implement them at all). trait MyTrait { - fn get(&self) -> uint; + fn get(&self) -> usize; } trait Even { } @@ -24,11 +24,11 @@ trait Even { } trait Odd { } impl<T:Even> MyTrait for T { //~ ERROR E0119 - fn get(&self) -> uint { 0 } + fn get(&self) -> usize { 0 } } impl<T:Odd> MyTrait for T { - fn get(&self) -> uint { 0 } + fn get(&self) -> usize { 0 } } fn main() { } diff --git a/src/test/compile-fail/coherence-blanket-conflicts-with-specific-multidispatch.rs b/src/test/compile-fail/coherence-blanket-conflicts-with-specific-multidispatch.rs index f3efca369b3..c3563792ce3 100644 --- a/src/test/compile-fail/coherence-blanket-conflicts-with-specific-multidispatch.rs +++ b/src/test/compile-fail/coherence-blanket-conflicts-with-specific-multidispatch.rs @@ -26,11 +26,11 @@ impl<T> MyTrait<T> for T { //~ ERROR E0119 #[derive(Clone)] struct MyType { - dummy: uint + dummy: usize } impl MyTrait<MyType> for MyType { - fn get(&self) -> uint { (*self).clone() } + fn get(&self) -> usize { (*self).clone() } } fn main() { } diff --git a/src/test/compile-fail/coherence-blanket-conflicts-with-specific-trait.rs b/src/test/compile-fail/coherence-blanket-conflicts-with-specific-trait.rs index 9db322a5517..eeaa68677eb 100644 --- a/src/test/compile-fail/coherence-blanket-conflicts-with-specific-trait.rs +++ b/src/test/compile-fail/coherence-blanket-conflicts-with-specific-trait.rs @@ -16,19 +16,19 @@ trait OtherTrait { } trait MyTrait { - fn get(&self) -> uint; + fn get(&self) -> usize; } impl<T:OtherTrait> MyTrait for T { //~ ERROR E0119 - fn get(&self) -> uint { 0 } + fn get(&self) -> usize { 0 } } struct MyType { - dummy: uint + dummy: usize } impl MyTrait for MyType { - fn get(&self) -> uint { self.dummy } + fn get(&self) -> usize { self.dummy } } impl OtherTrait for MyType { diff --git a/src/test/compile-fail/coherence-blanket-conflicts-with-specific.rs b/src/test/compile-fail/coherence-blanket-conflicts-with-specific.rs index 936025385bb..980e4256d2b 100644 --- a/src/test/compile-fail/coherence-blanket-conflicts-with-specific.rs +++ b/src/test/compile-fail/coherence-blanket-conflicts-with-specific.rs @@ -15,19 +15,19 @@ use std::default::Default; // specific T. trait MyTrait { - fn get(&self) -> uint; + fn get(&self) -> usize; } impl<T> MyTrait for T { //~ ERROR E0119 - fn get(&self) -> uint { 0 } + fn get(&self) -> usize { 0 } } struct MyType { - dummy: uint + dummy: usize } impl MyTrait for MyType { - fn get(&self) -> uint { self.dummy } + fn get(&self) -> usize { self.dummy } } fn main() { } diff --git a/src/test/compile-fail/coherence-orphan.rs b/src/test/compile-fail/coherence-orphan.rs index 568a35cc589..0bd0224b246 100644 --- a/src/test/compile-fail/coherence-orphan.rs +++ b/src/test/compile-fail/coherence-orphan.rs @@ -16,7 +16,7 @@ use lib::TheTrait; struct TheType; -impl TheTrait<uint> for isize { } //~ ERROR E0117 +impl TheTrait<usize> for isize { } //~ ERROR E0117 impl TheTrait<TheType> for isize { } //~ ERROR E0117 diff --git a/src/test/compile-fail/coherence-tuple-conflict.rs b/src/test/compile-fail/coherence-tuple-conflict.rs index 92fa725cb1e..9673fb6a213 100644 --- a/src/test/compile-fail/coherence-tuple-conflict.rs +++ b/src/test/compile-fail/coherence-tuple-conflict.rs @@ -15,15 +15,15 @@ use std::default::Default; // specific T. trait MyTrait { - fn get(&self) -> uint; + fn get(&self) -> usize; } impl<T> MyTrait for (T,T) { //~ ERROR E0119 - fn get(&self) -> uint { 0 } + fn get(&self) -> usize { 0 } } impl<A,B> MyTrait for (A,B) { - fn get(&self) -> uint { self.dummy } + fn get(&self) -> usize { self.dummy } } fn main() { } 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 1814b1cd544..053efe3b41b 100644 --- a/src/test/compile-fail/const-block-non-item-statement.rs +++ b/src/test/compile-fail/const-block-non-item-statement.rs @@ -8,18 +8,18 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -static A: uint = { 1u; 2 }; +static A: usize = { 1u; 2 }; //~^ ERROR: blocks in constants are limited to items and tail expressions -static B: uint = { { } 2 }; +static B: usize = { { } 2 }; //~^ ERROR: blocks in constants are limited to items and tail expressions macro_rules! foo { () => (()) //~ ERROR: blocks in constants are limited to items and tail expressions } -static C: uint = { foo!(); 2 }; +static C: usize = { foo!(); 2 }; -static D: uint = { let x = 4u; 2 }; +static D: usize = { let x = 4u; 2 }; //~^ ERROR: blocks in constants are limited to items and tail expressions pub fn main() { diff --git a/src/test/compile-fail/deriving-non-type.rs b/src/test/compile-fail/deriving-non-type.rs index 717ce6e11ef..324f189bbfb 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: uint = 0u; +static s: usize = 0u; #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums -const c: uint = 0u; +const c: usize = 0u; #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums mod m { } @@ -34,7 +34,7 @@ mod m { } extern "C" { } #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums -type A = uint; +type A = usize; #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums fn main() { } diff --git a/src/test/compile-fail/deriving-primitive.rs b/src/test/compile-fail/deriving-primitive.rs index 901f0c58f45..6e9b120aa69 100644 --- a/src/test/compile-fail/deriving-primitive.rs +++ b/src/test/compile-fail/deriving-primitive.rs @@ -22,7 +22,7 @@ struct B(isize); //~^^^ ERROR `FromPrimitive` cannot be derived for structs #[derive(FromPrimitive)] -enum C { Foo(isize), Bar(uint) } +enum C { Foo(isize), Bar(usize) } //~^^ ERROR `FromPrimitive` cannot be derived for enum variants with arguments //~^^^ ERROR `FromPrimitive` cannot be derived for enum variants with arguments diff --git a/src/test/compile-fail/dst-index.rs b/src/test/compile-fail/dst-index.rs index e297ecaac23..f64093200c4 100644 --- a/src/test/compile-fail/dst-index.rs +++ b/src/test/compile-fail/dst-index.rs @@ -18,10 +18,10 @@ struct S; impl Copy for S {} -impl Index<uint> for S { +impl Index<usize> for S { type Output = str; - fn index<'a>(&'a self, _: &uint) -> &'a str { + fn index<'a>(&'a self, _: &usize) -> &'a str { "hello" } } @@ -30,11 +30,11 @@ struct T; impl Copy for T {} -impl Index<uint> for T { +impl Index<usize> for T { type Output = Show + 'static; - fn index<'a>(&'a self, idx: &uint) -> &'a (Show + 'static) { - static x: uint = 42; + fn index<'a>(&'a self, idx: &usize) -> &'a (Show + 'static) { + static x: usize = 42; &x } } diff --git a/src/test/compile-fail/enum-discrim-too-small.rs b/src/test/compile-fail/enum-discrim-too-small.rs index 55e9b6d6ece..1d7794336a0 100644 --- a/src/test/compile-fail/enum-discrim-too-small.rs +++ b/src/test/compile-fail/enum-discrim-too-small.rs @@ -53,6 +53,6 @@ enum Ei32 { // u64 currently allows negative numbers, and i64 allows numbers greater than `1<<63`. This is a // little counterintuitive, but since the discriminant can store all the bits, and extracting it // with a cast requires specifying the signedness, there is no loss of information in those cases. -// This also applies to isize and uint on 64-bit targets. +// This also applies to isize and usize on 64-bit targets. pub fn main() { } diff --git a/src/test/compile-fail/extern-with-type-bounds.rs b/src/test/compile-fail/extern-with-type-bounds.rs index 8c7d00a9a11..d2c88865d54 100644 --- a/src/test/compile-fail/extern-with-type-bounds.rs +++ b/src/test/compile-fail/extern-with-type-bounds.rs @@ -22,10 +22,10 @@ extern "rust-intrinsic" { // Bounds aren't checked right now, so this should work // even though it's incorrect. - fn size_of<T: Clone>() -> uint; + fn size_of<T: Clone>() -> usize; // Unresolved bounds should still error. - fn align_of<T: NoSuchTrait>() -> uint; + fn align_of<T: NoSuchTrait>() -> usize; //~^ ERROR attempt to bound type parameter with a nonexistent trait `NoSuchTrait` } diff --git a/src/test/compile-fail/feature-gate-int-uint.rs b/src/test/compile-fail/feature-gate-int-uint.rs index 668c9980a2e..0c730b5f593 100644 --- a/src/test/compile-fail/feature-gate-int-uint.rs +++ b/src/test/compile-fail/feature-gate-int-uint.rs @@ -11,11 +11,11 @@ #![allow(dead_code)] mod u { - type X = uint; //~ WARN the `uint` type is deprecated + type X = usize; //~ WARN the `usize` type is deprecated struct Foo { - x: uint //~ WARN the `uint` type is deprecated + x: usize //~ WARN the `usize` type is deprecated } - fn bar(x: uint) { //~ WARN the `uint` type is deprecated + fn bar(x: usize) { //~ WARN the `usize` type is deprecated 1u; //~ WARN the `u` suffix on integers is deprecated } } diff --git a/src/test/compile-fail/fully-qualified-type-name3.rs b/src/test/compile-fail/fully-qualified-type-name3.rs index c69c30216f9..dc0c9a093ff 100644 --- a/src/test/compile-fail/fully-qualified-type-name3.rs +++ b/src/test/compile-fail/fully-qualified-type-name3.rs @@ -12,7 +12,7 @@ // ignore-test -type T1 = uint; +type T1 = usize; type T2 = isize; fn bar(x: T1) -> T2 { diff --git a/src/test/compile-fail/hrtb-debruijn-in-receiver.rs b/src/test/compile-fail/hrtb-debruijn-in-receiver.rs index 2dbd16107b0..2365f494075 100644 --- a/src/test/compile-fail/hrtb-debruijn-in-receiver.rs +++ b/src/test/compile-fail/hrtb-debruijn-in-receiver.rs @@ -14,7 +14,7 @@ use std::collections::HashMap; struct Foo<'a> { - map: HashMap<uint, &'a str> + map: HashMap<usize, &'a str> } impl<'a> Foo<'a> { diff --git a/src/test/compile-fail/huge-array-simple.rs b/src/test/compile-fail/huge-array-simple.rs index a9dda771b7f..1e04e685e41 100644 --- a/src/test/compile-fail/huge-array-simple.rs +++ b/src/test/compile-fail/huge-array-simple.rs @@ -11,5 +11,5 @@ // error-pattern: too big for the current fn main() { - let fat : [u8; (1<<61)+(1<<31)] = [0; (1u64<<61) as uint +(1u64<<31) as uint]; + let fat : [u8; (1<<61)+(1<<31)] = [0; (1u64<<61) as usize +(1u64<<31) as usize]; } diff --git a/src/test/compile-fail/import-glob-circular.rs b/src/test/compile-fail/import-glob-circular.rs index fda7b190d72..37c2d2ffdc5 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() -> uint { return 0u; } + pub fn common() -> usize { return 0u; } } mod circ2 { pub use circ1::f1; pub fn f2() { println!("f2"); } - pub fn common() -> uint { return 1u; } + pub fn common() -> usize { return 1u; } } mod test { diff --git a/src/test/compile-fail/indexing-requires-a-uint.rs b/src/test/compile-fail/indexing-requires-a-uint.rs index e40457a86c9..901d8783d02 100644 --- a/src/test/compile-fail/indexing-requires-a-uint.rs +++ b/src/test/compile-fail/indexing-requires-a-uint.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Make sure that indexing an array is only valid with a `uint`, not any other +// Make sure that indexing an array is only valid with a `usize`, not any other // integral type. fn main() { @@ -16,10 +16,10 @@ fn main() { [0][0u8]; //~ ERROR: the trait `core::ops::Index<u8>` is not implemented //~^ ERROR: the trait `core::ops::Index<u8>` is not implemented - [0][0]; // should infer to be a uint + [0][0]; // should infer to be a usize let i = 0; // i is an IntVar - [0][i]; // i should be locked to uint + [0][i]; // i should be locked to usize bar::<isize>(i); // i should not be re-coerced back to an isize //~^ ERROR: mismatched types } diff --git a/src/test/compile-fail/infinite-instantiation.rs b/src/test/compile-fail/infinite-instantiation.rs index b8fa6285d99..514557a96a4 100644 --- a/src/test/compile-fail/infinite-instantiation.rs +++ b/src/test/compile-fail/infinite-instantiation.rs @@ -15,8 +15,8 @@ trait to_opt { fn to_option(&self) -> Option<Self>; } -impl to_opt for uint { - fn to_option(&self) -> Option<uint> { +impl to_opt for usize { + fn to_option(&self) -> Option<usize> { Some(*self) } } @@ -27,7 +27,7 @@ impl<T:Clone> to_opt for Option<T> { } } -fn function<T:to_opt + Clone>(counter: uint, t: T) { +fn function<T:to_opt + Clone>(counter: usize, t: T) { if counter > 0u { function(counter - 1u, t.to_option()); } diff --git a/src/test/compile-fail/issue-10200.rs b/src/test/compile-fail/issue-10200.rs index 2b9ac705f32..03d4e9b81eb 100644 --- a/src/test/compile-fail/issue-10200.rs +++ b/src/test/compile-fail/issue-10200.rs @@ -9,7 +9,7 @@ // except according to those terms. struct Foo(bool); -fn foo(_: uint) -> Foo { Foo(false) } +fn foo(_: usize) -> Foo { Foo(false) } fn main() { match Foo(true) { diff --git a/src/test/compile-fail/issue-10636-1.rs b/src/test/compile-fail/issue-10636-1.rs index 710c5a306f3..bb020d55bdb 100644 --- a/src/test/compile-fail/issue-10636-1.rs +++ b/src/test/compile-fail/issue-10636-1.rs @@ -9,5 +9,5 @@ // except according to those terms. struct Obj { //~ NOTE: unclosed delimiter - member: uint + member: usize ) //~ ERROR: incorrect close delimiter diff --git a/src/test/compile-fail/issue-10877.rs b/src/test/compile-fail/issue-10877.rs index 132298eba99..39f25b837cd 100644 --- a/src/test/compile-fail/issue-10877.rs +++ b/src/test/compile-fail/issue-10877.rs @@ -18,7 +18,7 @@ extern { //~^ ERROR: patterns aren't allowed in foreign function declarations fn qux((x,y): ()); //~^ ERROR: patterns aren't allowed in foreign function declarations - fn this_is_actually_ok(a: uint); - fn and_so_is_this(_: uint); + fn this_is_actually_ok(a: usize); + fn and_so_is_this(_: usize); } fn main() {} diff --git a/src/test/compile-fail/issue-13359.rs b/src/test/compile-fail/issue-13359.rs index 607874de49d..2e338860377 100644 --- a/src/test/compile-fail/issue-13359.rs +++ b/src/test/compile-fail/issue-13359.rs @@ -16,6 +16,6 @@ fn main() { foo(1*(1 as isize)); //~^ ERROR: mismatched types: expected `i16`, found `isize` (expected i16, found isize) - bar(1*(1 as uint)); + bar(1*(1 as usize)); //~^ ERROR: mismatched types: expected `u32`, found `usize` (expected u32, found usize) } diff --git a/src/test/compile-fail/issue-1362.rs b/src/test/compile-fail/issue-1362.rs index bfbbc9d8aed..64c503376d5 100644 --- a/src/test/compile-fail/issue-1362.rs +++ b/src/test/compile-fail/issue-1362.rs @@ -11,7 +11,7 @@ // Regression test for issue #1362 - without that fix the span will be bogus // no-reformat fn main() { - let x: uint = 20i; //~ ERROR mismatched types + let x: usize = 20i; //~ ERROR mismatched types } // NOTE: Do not add any extra lines as the line number the error is // on is significant; an error later in the source file might not diff --git a/src/test/compile-fail/issue-14303-fncall.rs b/src/test/compile-fail/issue-14303-fncall.rs index 3a5c8bbc546..0ec64ba6a3f 100644 --- a/src/test/compile-fail/issue-14303-fncall.rs +++ b/src/test/compile-fail/issue-14303-fncall.rs @@ -11,6 +11,6 @@ fn main() { range(0, 4) .map(|x| x * 2) - .collect::<Vec<'a, uint, 'b>>() + .collect::<Vec<'a, usize, 'b>>() //~^ ERROR lifetime parameters must be declared prior to type parameters } diff --git a/src/test/compile-fail/issue-1448-2.rs b/src/test/compile-fail/issue-1448-2.rs index 234fa85c89a..72803ea9ad1 100644 --- a/src/test/compile-fail/issue-1448-2.rs +++ b/src/test/compile-fail/issue-1448-2.rs @@ -10,7 +10,7 @@ // Regression test for issue #1448 and #1386 -fn foo(a: uint) -> uint { a } +fn foo(a: usize) -> usize { a } fn main() { println!("{}", foo(10i)); //~ ERROR mismatched types diff --git a/src/test/compile-fail/issue-15260.rs b/src/test/compile-fail/issue-15260.rs index e3d19729710..2228b6d3779 100644 --- a/src/test/compile-fail/issue-15260.rs +++ b/src/test/compile-fail/issue-15260.rs @@ -9,7 +9,7 @@ // except according to those terms. struct Foo { - a: uint, + a: usize, } fn main() { diff --git a/src/test/compile-fail/issue-15783.rs b/src/test/compile-fail/issue-15783.rs index f3e7a65db48..1b1b0302383 100644 --- a/src/test/compile-fail/issue-15783.rs +++ b/src/test/compile-fail/issue-15783.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn foo(params: Option<&[&str]>) -> uint { +pub fn foo(params: Option<&[&str]>) -> usize { params.unwrap().first().unwrap().len() } diff --git a/src/test/compile-fail/issue-15896.rs b/src/test/compile-fail/issue-15896.rs index 7b91063e2f9..c4373ba3351 100644 --- a/src/test/compile-fail/issue-15896.rs +++ b/src/test/compile-fail/issue-15896.rs @@ -12,7 +12,7 @@ fn main() { enum R { REB(()) } - struct Tau { t: uint } + struct Tau { t: usize } enum E { B(R, Tau) } let e = E::B(R::REB(()), Tau { t: 3 }); diff --git a/src/test/compile-fail/issue-16538.rs b/src/test/compile-fail/issue-16538.rs index af686b86813..a6b73dcc19c 100644 --- a/src/test/compile-fail/issue-16538.rs +++ b/src/test/compile-fail/issue-16538.rs @@ -9,9 +9,9 @@ // except according to those terms. mod Y { - type X = uint; + type X = usize; extern { - static x: *const uint; + static x: *const usize; } fn foo(value: *const X) -> *const X { value diff --git a/src/test/compile-fail/issue-16562.rs b/src/test/compile-fail/issue-16562.rs index 626a442a2c3..a400263a243 100644 --- a/src/test/compile-fail/issue-16562.rs +++ b/src/test/compile-fail/issue-16562.rs @@ -15,11 +15,11 @@ struct Col<D, C> { col: C, } -trait Collection { fn len(&self) -> uint; } +trait Collection { fn len(&self) -> usize; } -impl<T, M: MatrixShape> Collection for Col<M, uint> { +impl<T, M: MatrixShape> Collection for Col<M, usize> { //~^ ERROR type parameter `T` is not constrained - fn len(&self) -> uint { + fn len(&self) -> usize { unimplemented!() } } diff --git a/src/test/compile-fail/issue-16747.rs b/src/test/compile-fail/issue-16747.rs index 22e3e9ed09e..814b885e3aa 100644 --- a/src/test/compile-fail/issue-16747.rs +++ b/src/test/compile-fail/issue-16747.rs @@ -12,7 +12,7 @@ trait ListItem<'a> { fn list_name() -> &'a str; } -trait Collection { fn len(&self) -> uint; } +trait Collection { fn len(&self) -> usize; } struct List<'a, T: ListItem<'a>> { //~^ ERROR the parameter type `T` may not live long enough @@ -22,7 +22,7 @@ struct List<'a, T: ListItem<'a>> { } impl<'a, T: ListItem<'a>> Collection for List<'a, T> { - fn len(&self) -> uint { + fn len(&self) -> usize { 0 } } diff --git a/src/test/compile-fail/issue-17252.rs b/src/test/compile-fail/issue-17252.rs index 4adb3f041a3..2e9ef8d6077 100644 --- a/src/test/compile-fail/issue-17252.rs +++ b/src/test/compile-fail/issue-17252.rs @@ -8,12 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -static FOO: uint = FOO; //~ ERROR recursive constant +static FOO: usize = FOO; //~ ERROR recursive constant fn main() { let _x: [u8; FOO]; // caused stack overflow prior to fix - let _y: uint = 1 + { - static BAR: uint = BAR; //~ ERROR recursive constant + let _y: usize = 1 + { + static BAR: usize = BAR; //~ ERROR recursive constant let _z: [u8; BAR]; // caused stack overflow prior to fix 1 }; diff --git a/src/test/compile-fail/issue-17283.rs b/src/test/compile-fail/issue-17283.rs index 122c1f08395..9f76feeaf04 100644 --- a/src/test/compile-fail/issue-17283.rs +++ b/src/test/compile-fail/issue-17283.rs @@ -12,7 +12,7 @@ // within assignments in if expressions. struct Foo { - foo: uint + foo: usize } fn main() { diff --git a/src/test/compile-fail/issue-17458.rs b/src/test/compile-fail/issue-17458.rs index b1fbe6f5549..d9fd67f9197 100644 --- a/src/test/compile-fail/issue-17458.rs +++ b/src/test/compile-fail/issue-17458.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -static X: uint = 0 as *const uint as uint; +static X: usize = 0 as *const usize as usize; //~^ ERROR: can not cast a pointer to an integer in a constant expression fn main() { diff --git a/src/test/compile-fail/issue-17718-borrow-interior.rs b/src/test/compile-fail/issue-17718-borrow-interior.rs index 8aa5fdf1c4d..d33c12668f2 100644 --- a/src/test/compile-fail/issue-17718-borrow-interior.rs +++ b/src/test/compile-fail/issue-17718-borrow-interior.rs @@ -8,17 +8,17 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct S { a: uint } +struct S { a: usize } static A: S = S { a: 3 }; -static B: &'static uint = &A.a; +static B: &'static usize = &A.a; //~^ ERROR: cannot refer to the interior of another static -static C: &'static uint = &(A.a); +static C: &'static usize = &(A.a); //~^ ERROR: cannot refer to the interior of another static -static D: [uint; 1] = [1]; -static E: uint = D[0]; +static D: [usize; 1] = [1]; +static E: usize = D[0]; //~^ ERROR: cannot refer to other statics by value -static F: &'static uint = &D[0]; +static F: &'static usize = &D[0]; //~^ ERROR: cannot refer to the interior of another static fn main() {} diff --git a/src/test/compile-fail/issue-17718-const-bad-values.rs b/src/test/compile-fail/issue-17718-const-bad-values.rs index 6425dbda5c6..daa250d12f5 100644 --- a/src/test/compile-fail/issue-17718-const-bad-values.rs +++ b/src/test/compile-fail/issue-17718-const-bad-values.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -const C1: &'static mut [uint] = &mut []; +const C1: &'static mut [usize] = &mut []; //~^ ERROR: constants are not allowed to have mutable references -static mut S: uint = 3; -const C2: &'static mut uint = &mut S; +static mut S: usize = 3; +const C2: &'static mut usize = &mut S; //~^ ERROR: constants cannot refer to other statics //~^^ ERROR: are not allowed to have mutable references diff --git a/src/test/compile-fail/issue-17718-const-borrow.rs b/src/test/compile-fail/issue-17718-const-borrow.rs index 21cc9a757cf..dfa5bca8ccd 100644 --- a/src/test/compile-fail/issue-17718-const-borrow.rs +++ b/src/test/compile-fail/issue-17718-const-borrow.rs @@ -10,13 +10,13 @@ use std::cell::UnsafeCell; -const A: UnsafeCell<uint> = UnsafeCell { value: 1 }; -const B: &'static UnsafeCell<uint> = &A; +const A: UnsafeCell<usize> = UnsafeCell { value: 1 }; +const B: &'static UnsafeCell<usize> = &A; //~^ ERROR: cannot borrow a constant which contains interior mutability -struct C { a: UnsafeCell<uint> } +struct C { a: UnsafeCell<usize> } const D: C = C { a: UnsafeCell { value: 1 } }; -const E: &'static UnsafeCell<uint> = &D.a; +const E: &'static UnsafeCell<usize> = &D.a; //~^ ERROR: cannot borrow a constant which contains interior mutability const F: &'static C = &D; //~^ ERROR: cannot borrow a constant which contains interior mutability diff --git a/src/test/compile-fail/issue-17718-const-mut.rs b/src/test/compile-fail/issue-17718-const-mut.rs index 12b9cf4ba8c..5177ebbc188 100644 --- a/src/test/compile-fail/issue-17718-const-mut.rs +++ b/src/test/compile-fail/issue-17718-const-mut.rs @@ -11,7 +11,7 @@ const mut //~ ERROR: const globals cannot be mutable //~^ HELP did you mean to declare a static? -FOO: uint = 3; +FOO: usize = 3; fn main() { } diff --git a/src/test/compile-fail/issue-17718-const-privacy.rs b/src/test/compile-fail/issue-17718-const-privacy.rs index d3be9f3dd3f..a9af30a3ff0 100644 --- a/src/test/compile-fail/issue-17718-const-privacy.rs +++ b/src/test/compile-fail/issue-17718-const-privacy.rs @@ -20,7 +20,7 @@ use other::{ }; mod a { - const B: uint = 3; + const B: usize = 3; } fn main() {} diff --git a/src/test/compile-fail/issue-17718-constants-not-static.rs b/src/test/compile-fail/issue-17718-constants-not-static.rs index 8c51b592054..db56d2c6cf3 100644 --- a/src/test/compile-fail/issue-17718-constants-not-static.rs +++ b/src/test/compile-fail/issue-17718-constants-not-static.rs @@ -8,9 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -const FOO: uint = 3; +const FOO: usize = 3; -fn foo() -> &'static uint { &FOO } +fn foo() -> &'static usize { &FOO } //~^ ERROR: borrowed value does not live long enough fn main() { diff --git a/src/test/compile-fail/issue-17718-patterns.rs b/src/test/compile-fail/issue-17718-patterns.rs index 01dfb1b4af9..ab95606da44 100644 --- a/src/test/compile-fail/issue-17718-patterns.rs +++ b/src/test/compile-fail/issue-17718-patterns.rs @@ -8,9 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -static A1: uint = 1; -static mut A2: uint = 1; -const A3: uint = 1; +static A1: usize = 1; +static mut A2: usize = 1; +const A3: usize = 1; fn main() { match 1u { diff --git a/src/test/compile-fail/issue-17718-recursive.rs b/src/test/compile-fail/issue-17718-recursive.rs index a13dfe639c1..9959b0c6fc5 100644 --- a/src/test/compile-fail/issue-17718-recursive.rs +++ b/src/test/compile-fail/issue-17718-recursive.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -const A: uint = B; //~ ERROR: recursive constant -const B: uint = A; //~ ERROR: recursive constant +const A: usize = B; //~ ERROR: recursive constant +const B: usize = A; //~ ERROR: recursive constant fn main() {} diff --git a/src/test/compile-fail/issue-17718-references.rs b/src/test/compile-fail/issue-17718-references.rs index 7b272e1610c..9d8b116f569 100644 --- a/src/test/compile-fail/issue-17718-references.rs +++ b/src/test/compile-fail/issue-17718-references.rs @@ -8,21 +8,21 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct Struct { a: uint } +struct Struct { a: usize } -const C: uint = 1; -static S: uint = 1; +const C: usize = 1; +static S: usize = 1; -const T1: &'static uint = &C; -const T2: &'static uint = &S; //~ ERROR: constants cannot refer to other statics -static T3: &'static uint = &C; -static T4: &'static uint = &S; +const T1: &'static usize = &C; +const T2: &'static usize = &S; //~ ERROR: constants cannot refer to other statics +static T3: &'static usize = &C; +static T4: &'static usize = &S; -const T5: uint = C; -const T6: uint = S; //~ ERROR: constants cannot refer to other statics +const T5: usize = C; +const T6: usize = S; //~ ERROR: constants cannot refer to other statics //~^ cannot refer to other statics -static T7: uint = C; -static T8: uint = S; //~ ERROR: cannot refer to other statics by value +static T7: usize = C; +static T8: usize = S; //~ ERROR: cannot refer to other statics by value const T9: Struct = Struct { a: C }; const T10: Struct = Struct { a: S }; //~ ERROR: cannot refer to other statics by value diff --git a/src/test/compile-fail/issue-17718-static-sync.rs b/src/test/compile-fail/issue-17718-static-sync.rs index 147bff2e977..394a9cc69be 100644 --- a/src/test/compile-fail/issue-17718-static-sync.rs +++ b/src/test/compile-fail/issue-17718-static-sync.rs @@ -12,7 +12,7 @@ use std::marker; struct Foo { marker: marker::NoSync } -static FOO: uint = 3; +static FOO: usize = 3; static BAR: Foo = Foo { marker: marker::NoSync }; //~^ ERROR: the trait `core::marker::Sync` is not implemented diff --git a/src/test/compile-fail/issue-17933.rs b/src/test/compile-fail/issue-17933.rs index de5a38507bc..1a490245cfc 100644 --- a/src/test/compile-fail/issue-17933.rs +++ b/src/test/compile-fail/issue-17933.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub static X: uint = 1u; +pub static X: usize = 1u; fn main() { match 1u { diff --git a/src/test/compile-fail/issue-18252.rs b/src/test/compile-fail/issue-18252.rs index 02493b96dc8..dd9626f74ec 100644 --- a/src/test/compile-fail/issue-18252.rs +++ b/src/test/compile-fail/issue-18252.rs @@ -9,7 +9,7 @@ // except according to those terms. enum Foo { - Variant { x: uint } + Variant { x: usize } } fn main() { diff --git a/src/test/compile-fail/issue-18294.rs b/src/test/compile-fail/issue-18294.rs index ca4cf526f07..efc1ba1635c 100644 --- a/src/test/compile-fail/issue-18294.rs +++ b/src/test/compile-fail/issue-18294.rs @@ -10,6 +10,6 @@ fn main() { const X: u32 = 1; - const Y: uint = &X as *const u32 as uint; //~ ERROR E0018 + const Y: usize = &X as *const u32 as usize; //~ ERROR E0018 println!("{}", Y); } diff --git a/src/test/compile-fail/issue-18566.rs b/src/test/compile-fail/issue-18566.rs index 0d1a1f16c2c..17dc59dbc8d 100644 --- a/src/test/compile-fail/issue-18566.rs +++ b/src/test/compile-fail/issue-18566.rs @@ -10,19 +10,19 @@ use std::ops::Deref; -struct MyPtr<'a>(&'a mut uint); +struct MyPtr<'a>(&'a mut usize); impl<'a> Deref for MyPtr<'a> { - type Target = uint; + type Target = usize; - fn deref<'b>(&'b self) -> &'b uint { self.0 } + fn deref<'b>(&'b self) -> &'b usize { self.0 } } trait Tr { - fn poke(&self, s: &mut uint); + fn poke(&self, s: &mut usize); } -impl Tr for uint { - fn poke(&self, s: &mut uint) { +impl Tr for usize { + fn poke(&self, s: &mut usize) { *s = 2; } } diff --git a/src/test/compile-fail/issue-19244-1.rs b/src/test/compile-fail/issue-19244-1.rs index c3700f2f90a..0850705aee6 100644 --- a/src/test/compile-fail/issue-19244-1.rs +++ b/src/test/compile-fail/issue-19244-1.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -const TUP: (uint,) = (42,); +const TUP: (usize,) = (42,); fn main() { let a: [isize; TUP.1]; diff --git a/src/test/compile-fail/issue-19244-2.rs b/src/test/compile-fail/issue-19244-2.rs index 7c7271552d2..93a3fc87eb0 100644 --- a/src/test/compile-fail/issue-19244-2.rs +++ b/src/test/compile-fail/issue-19244-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct MyStruct { field: uint } +struct MyStruct { field: usize } const STRUCT: MyStruct = MyStruct { field: 42 }; fn main() { diff --git a/src/test/compile-fail/issue-2111.rs b/src/test/compile-fail/issue-2111.rs index 3d9c7401ded..8180ce52bdb 100644 --- a/src/test/compile-fail/issue-2111.rs +++ b/src/test/compile-fail/issue-2111.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn foo(a: Option<uint>, b: Option<uint>) { +fn foo(a: Option<usize>, b: Option<usize>) { match (a,b) { //~^ ERROR: non-exhaustive patterns: `(None, None)` not covered (Some(a), Some(b)) if a == b => { } diff --git a/src/test/compile-fail/issue-2150.rs b/src/test/compile-fail/issue-2150.rs index 90b5ff8475e..5ebc445bace 100644 --- a/src/test/compile-fail/issue-2150.rs +++ b/src/test/compile-fail/issue-2150.rs @@ -12,7 +12,7 @@ #![allow(unused_variables)] #![allow(dead_code)] -fn fail_len(v: Vec<isize> ) -> uint { +fn fail_len(v: Vec<isize> ) -> usize { let mut i = 3; panic!(); for x in v.iter() { i += 1u; } diff --git a/src/test/compile-fail/issue-2356.rs b/src/test/compile-fail/issue-2356.rs index d6acc13c289..f0ae0eb59f5 100644 --- a/src/test/compile-fail/issue-2356.rs +++ b/src/test/compile-fail/issue-2356.rs @@ -30,7 +30,7 @@ impl MaybeDog { } impl Groom for cat { - fn shave(&self, other: uint) { + fn shave(&self, other: usize) { whiskers -= other; //~^ ERROR: unresolved name `whiskers`. Did you mean `self.whiskers`? shave(4); @@ -75,7 +75,7 @@ impl cat { //~^ ERROR: unresolved name `whiskers`. Did you mean `self.whiskers`? } - pub fn grow_older(other:uint) { + pub fn grow_older(other:usize) { whiskers = 4; //~^ ERROR: unresolved name `whiskers`. Did you mean `self.whiskers`? purr_louder(); diff --git a/src/test/compile-fail/issue-3344.rs b/src/test/compile-fail/issue-3344.rs index 27a91f891a2..73532cb768a 100644 --- a/src/test/compile-fail/issue-3344.rs +++ b/src/test/compile-fail/issue-3344.rs @@ -9,7 +9,7 @@ // except according to those terms. #[derive(PartialEq)] -struct thing(uint); +struct thing(usize); impl PartialOrd for thing { //~ ERROR not all trait items implemented, missing: `partial_cmp` fn le(&self, other: &thing) -> bool { true } fn ge(&self, other: &thing) -> bool { true } diff --git a/src/test/compile-fail/issue-3707.rs b/src/test/compile-fail/issue-3707.rs index 2445638d62e..ad818cf9f83 100644 --- a/src/test/compile-fail/issue-3707.rs +++ b/src/test/compile-fail/issue-3707.rs @@ -9,7 +9,7 @@ // except according to those terms. struct Obj { - member: uint + member: usize } impl Obj { diff --git a/src/test/compile-fail/issue-4265.rs b/src/test/compile-fail/issue-4265.rs index a1a77092b12..b4bc7ecdc5f 100644 --- a/src/test/compile-fail/issue-4265.rs +++ b/src/test/compile-fail/issue-4265.rs @@ -9,7 +9,7 @@ // except according to those terms. struct Foo { - baz: uint + baz: usize } impl Foo { diff --git a/src/test/compile-fail/issue-4935.rs b/src/test/compile-fail/issue-4935.rs index 3a0db4246be..b37b8e237ed 100644 --- a/src/test/compile-fail/issue-4935.rs +++ b/src/test/compile-fail/issue-4935.rs @@ -10,5 +10,5 @@ // Regression test for issue #4935 -fn foo(a: uint) {} +fn foo(a: usize) {} fn main() { foo(5, 6) } //~ ERROR this function takes 1 parameter but 2 parameters were supplied diff --git a/src/test/compile-fail/issue-5358-1.rs b/src/test/compile-fail/issue-5358-1.rs index 576dfe8b67b..96bad3a6a44 100644 --- a/src/test/compile-fail/issue-5358-1.rs +++ b/src/test/compile-fail/issue-5358-1.rs @@ -9,7 +9,7 @@ // except according to those terms. enum Either<T, U> { Left(T), Right(U) } -struct S(Either<uint, uint>); +struct S(Either<usize, usize>); fn main() { match S(Either::Left(5)) { diff --git a/src/test/compile-fail/issue-5500-1.rs b/src/test/compile-fail/issue-5500-1.rs index 0edcfa8a547..7e5809cdee0 100644 --- a/src/test/compile-fail/issue-5500-1.rs +++ b/src/test/compile-fail/issue-5500-1.rs @@ -9,7 +9,7 @@ // except according to those terms. struct TrieMapIterator<'a> { - node: &'a uint + node: &'a usize } fn main() { diff --git a/src/test/compile-fail/issue-6801.rs b/src/test/compile-fail/issue-6801.rs index 27230989f63..9424ff22dc7 100644 --- a/src/test/compile-fail/issue-6801.rs +++ b/src/test/compile-fail/issue-6801.rs @@ -14,16 +14,16 @@ #![feature(box_syntax)] -fn twice(x: Box<uint>) -> uint { +fn twice(x: Box<usize>) -> usize { *x * 2 } -fn invoke<F>(f: F) where F: FnOnce() -> uint { +fn invoke<F>(f: F) where F: FnOnce() -> usize { f(); } fn main() { - let x : Box<uint> = box 9; + let x : Box<usize> = box 9; let sq = |:| { *x * *x }; twice(x); //~ ERROR: cannot move out of diff --git a/src/test/compile-fail/issue-6991.rs b/src/test/compile-fail/issue-6991.rs index a5d23c70bd5..0cc5898adfc 100644 --- a/src/test/compile-fail/issue-6991.rs +++ b/src/test/compile-fail/issue-6991.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -static x: &'static uint = &1; -static y: uint = *x; +static x: &'static usize = &1; +static y: usize = *x; //~^ ERROR cannot refer to other statics by value, // use the address-of operator or a constant instead fn main() {} diff --git a/src/test/compile-fail/issue-7607-2.rs b/src/test/compile-fail/issue-7607-2.rs index 8a7022a9a32..9541899b469 100644 --- a/src/test/compile-fail/issue-7607-2.rs +++ b/src/test/compile-fail/issue-7607-2.rs @@ -11,7 +11,7 @@ // ignore-tidy-linelength pub mod a { - pub struct Foo { a: uint } + pub struct Foo { a: usize } } pub mod b { diff --git a/src/test/compile-fail/issue-9957.rs b/src/test/compile-fail/issue-9957.rs index 573d847cbe3..b1204e82890 100644 --- a/src/test/compile-fail/issue-9957.rs +++ b/src/test/compile-fail/issue-9957.rs @@ -11,5 +11,5 @@ pub extern crate core; //~ ERROR: `pub` visibility is not allowed fn main() { - pub use std::uint; //~ ERROR: imports in functions are never reachable + pub use std::usize; //~ ERROR: imports in functions are never reachable } diff --git a/src/test/compile-fail/kindck-nonsendable-1.rs b/src/test/compile-fail/kindck-nonsendable-1.rs index a13a3f7c4ab..172587dc1e4 100644 --- a/src/test/compile-fail/kindck-nonsendable-1.rs +++ b/src/test/compile-fail/kindck-nonsendable-1.rs @@ -11,7 +11,7 @@ use std::rc::Rc; -fn foo(_x: Rc<uint>) {} +fn foo(_x: Rc<usize>) {} fn bar<F:FnOnce() + Send>(_: F) { } diff --git a/src/test/compile-fail/lifetime-inference-give-expl-lifetime-param-2.rs b/src/test/compile-fail/lifetime-inference-give-expl-lifetime-param-2.rs index 7d91b1998bf..fac518c7635 100644 --- a/src/test/compile-fail/lifetime-inference-give-expl-lifetime-param-2.rs +++ b/src/test/compile-fail/lifetime-inference-give-expl-lifetime-param-2.rs @@ -14,15 +14,15 @@ use std::iter::{Range,range}; trait Itble<'r, T, I: Iterator<Item=T>> { fn iter(&'r self) -> I; } -impl<'r> Itble<'r, uint, Range<uint>> for (uint, uint) { - fn iter(&'r self) -> Range<uint> { +impl<'r> Itble<'r, usize, Range<usize>> for (usize, usize) { + fn iter(&'r self) -> Range<usize> { let &(min, max) = self; range(min, max) } } -fn check<'r, I: Iterator<Item=uint>, T: Itble<'r, uint, I>>(cont: &T) -> bool { -//~^ HELP: consider using an explicit lifetime parameter as shown: fn check<'r, I: Iterator<Item = uint>, T: Itble<'r, uint, I>>(cont: &'r T) +fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool { +//~^ HELP: consider using an explicit lifetime parameter as shown: fn check<'r, I: Iterator<Item = usize>, T: Itble<'r, usize, I>>(cont: &'r T) let cont_iter = cont.iter(); //~ ERROR: cannot infer let result = cont_iter.fold(Some(0u16), |state, val| { state.map_or(None, |mask| { diff --git a/src/test/compile-fail/lint-ctypes.rs b/src/test/compile-fail/lint-ctypes.rs index e0ed095b1a1..801f9dfd1cf 100644 --- a/src/test/compile-fail/lint-ctypes.rs +++ b/src/test/compile-fail/lint-ctypes.rs @@ -14,9 +14,9 @@ extern crate libc; extern { pub fn bare_type1(size: isize); //~ ERROR: found rust type - pub fn bare_type2(size: uint); //~ ERROR: found rust type + pub fn bare_type2(size: usize); //~ ERROR: found rust type pub fn ptr_type1(size: *const isize); //~ ERROR: found rust type - pub fn ptr_type2(size: *const uint); //~ ERROR: found rust type + pub fn ptr_type2(size: *const usize); //~ ERROR: found rust type pub fn good1(size: *const libc::c_int); pub fn good2(size: *const libc::c_uint); diff --git a/src/test/compile-fail/lint-dead-code-4.rs b/src/test/compile-fail/lint-dead-code-4.rs index 2653c1d5b24..bc2e0940f44 100644 --- a/src/test/compile-fail/lint-dead-code-4.rs +++ b/src/test/compile-fail/lint-dead-code-4.rs @@ -17,12 +17,12 @@ extern crate libc; use std::num::Int; struct Foo { - x: uint, + x: usize, b: bool, //~ ERROR: struct field is never used marker: std::marker::NoCopy } -fn field_read(f: Foo) -> uint { +fn field_read(f: Foo) -> usize { f.x.pow(2) } @@ -43,7 +43,7 @@ fn field_match_in_patterns(b: XYZ) -> String { } struct Bar { - x: uint, //~ ERROR: struct field is never used + x: usize, //~ ERROR: struct field is never used b: bool, _guard: () } diff --git a/src/test/compile-fail/lint-exceeding-bitshifts.rs b/src/test/compile-fail/lint-exceeding-bitshifts.rs index cbb416b62a6..3d8d5b407fd 100644 --- a/src/test/compile-fail/lint-exceeding-bitshifts.rs +++ b/src/test/compile-fail/lint-exceeding-bitshifts.rs @@ -57,6 +57,6 @@ fn main() { let n = 1u8 << (4+4); //~ ERROR: bitshift exceeds the type's number of bits let n = 1i << std::isize::BITS; //~ ERROR: bitshift exceeds the type's number of bits - let n = 1u << std::uint::BITS; //~ ERROR: bitshift exceeds the type's number of bits + let n = 1u << std::usize::BITS; //~ ERROR: bitshift exceeds the type's number of bits } diff --git a/src/test/compile-fail/lint-raw-ptr-derive.rs b/src/test/compile-fail/lint-raw-ptr-derive.rs index 9fcd6b33c9d..4320b3e7441 100644 --- a/src/test/compile-fail/lint-raw-ptr-derive.rs +++ b/src/test/compile-fail/lint-raw-ptr-derive.rs @@ -28,7 +28,7 @@ enum Baz { #[derive(Clone)] struct Buzz { x: (*const isize, //~ ERROR use of `#[derive]` with a raw pointer - *const uint) //~ ERROR use of `#[derive]` with a raw pointer + *const usize) //~ ERROR use of `#[derive]` with a raw pointer } fn main() {} diff --git a/src/test/compile-fail/lint-stability.rs b/src/test/compile-fail/lint-stability.rs index b0a3a6bd10e..c8469fb7f8c 100644 --- a/src/test/compile-fail/lint-stability.rs +++ b/src/test/compile-fail/lint-stability.rs @@ -174,7 +174,7 @@ mod inheritance { let _ = Experimental::ExperimentalVariant; //~ ERROR use of experimental item let _ = Experimental::StableVariant; - let x: uint = 0; + let x: usize = 0; x.experimental(); //~ ERROR use of experimental item x.stable(); } diff --git a/src/test/compile-fail/lint-unused-extern-crate.rs b/src/test/compile-fail/lint-unused-extern-crate.rs index a77de551f5d..c9d34d40479 100644 --- a/src/test/compile-fail/lint-unused-extern-crate.rs +++ b/src/test/compile-fail/lint-unused-extern-crate.rs @@ -28,6 +28,6 @@ use rand::isaac::IsaacRng; use other::*; fn main() { - let x: collecs::vec::Vec<uint> = Vec::new(); + let x: collecs::vec::Vec<usize> = Vec::new(); let y = foo(); } diff --git a/src/test/compile-fail/lint-unused-imports.rs b/src/test/compile-fail/lint-unused-imports.rs index 44579bb55e0..a6d7c587c7b 100644 --- a/src/test/compile-fail/lint-unused-imports.rs +++ b/src/test/compile-fail/lint-unused-imports.rs @@ -44,7 +44,7 @@ mod test { mod foo { pub struct Point{pub x: isize, pub y: isize} - pub struct Square{pub p: Point, pub h: uint, pub w: uint} + pub struct Square{pub p: Point, pub h: usize, pub w: usize} } mod bar { diff --git a/src/test/compile-fail/lint-uppercase-variables.rs b/src/test/compile-fail/lint-uppercase-variables.rs index b6eda8635c2..9317e465a7a 100644 --- a/src/test/compile-fail/lint-uppercase-variables.rs +++ b/src/test/compile-fail/lint-uppercase-variables.rs @@ -17,15 +17,15 @@ use std::io::File; use std::io::IoError; struct Something { - X: uint //~ ERROR structure field `X` should have a snake case name such as `x` + X: usize //~ ERROR structure field `X` should have a snake case name such as `x` } -fn test(Xx: uint) { //~ ERROR variable `Xx` should have a snake case name such as `xx` +fn test(Xx: usize) { //~ ERROR variable `Xx` should have a snake case name such as `xx` println!("{}", Xx); } fn main() { - let Test: uint = 0; //~ ERROR variable `Test` should have a snake case name such as `test` + let Test: usize = 0; //~ ERROR variable `Test` should have a snake case name such as `test` println!("{}", Test); let mut f = File::open(&Path::new("something.txt")); diff --git a/src/test/compile-fail/liveness-bad-bang-2.rs b/src/test/compile-fail/liveness-bad-bang-2.rs index 04364e4e010..c612a023365 100644 --- a/src/test/compile-fail/liveness-bad-bang-2.rs +++ b/src/test/compile-fail/liveness-bad-bang-2.rs @@ -10,7 +10,7 @@ // Tests that a function with a ! annotation always actually fails -fn bad_bang(i: uint) -> ! { //~ 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 println!("{}", 3i); } diff --git a/src/test/compile-fail/match-pattern-field-mismatch-2.rs b/src/test/compile-fail/match-pattern-field-mismatch-2.rs index ab9efdcc8cc..e63ddf6c7fd 100644 --- a/src/test/compile-fail/match-pattern-field-mismatch-2.rs +++ b/src/test/compile-fail/match-pattern-field-mismatch-2.rs @@ -10,8 +10,8 @@ fn main() { enum color { - rgb(uint, uint, uint), - cmyk(uint, uint, uint, uint), + rgb(usize, usize, usize), + cmyk(usize, usize, usize, usize), no_color, } diff --git a/src/test/compile-fail/match-pattern-field-mismatch.rs b/src/test/compile-fail/match-pattern-field-mismatch.rs index 243690bbf31..8426ecdaf99 100644 --- a/src/test/compile-fail/match-pattern-field-mismatch.rs +++ b/src/test/compile-fail/match-pattern-field-mismatch.rs @@ -10,8 +10,8 @@ fn main() { enum color { - rgb(uint, uint, uint), - cmyk(uint, uint, uint, uint), + rgb(usize, usize, usize), + cmyk(usize, usize, usize, usize), no_color, } diff --git a/src/test/compile-fail/method-ambig-one-trait-unknown-int-type.rs b/src/test/compile-fail/method-ambig-one-trait-unknown-int-type.rs index f0cc7c80417..c6d45f1c9db 100644 --- a/src/test/compile-fail/method-ambig-one-trait-unknown-int-type.rs +++ b/src/test/compile-fail/method-ambig-one-trait-unknown-int-type.rs @@ -16,7 +16,7 @@ trait foo { fn foo(&self) -> isize; } -impl foo for Vec<uint> { +impl foo for Vec<usize> { fn foo(&self) -> isize {1} } @@ -39,7 +39,7 @@ fn m2() { let mut x = Vec::new(); // ...but we still resolved `foo()` to the trait and hence know the return type. - let y: uint = x.foo(); //~ ERROR mismatched types + let y: usize = x.foo(); //~ ERROR mismatched types } fn main() { } 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 30e635149c4..91d1e73e232 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 @@ -15,8 +15,8 @@ extern crate ambig_impl_2_lib; use ambig_impl_2_lib::me; trait me2 { - fn me(&self) -> uint; + fn me(&self) -> usize; } -impl me2 for uint { fn me(&self) -> uint { *self } } +impl me2 for usize { fn me(&self) -> usize { *self } } fn main() { 1u.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 87efaed4e3d..dc5f1023b99 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 @@ -15,8 +15,8 @@ trait Foo { fn method(&self) {} } trait Bar { fn method(&self) {} } -impl Foo for uint {} -impl Bar for uint {} +impl Foo for usize {} +impl Bar for usize {} fn main() { 1u.method(); //~ ERROR E0034 diff --git a/src/test/compile-fail/move-fragments-9.rs b/src/test/compile-fail/move-fragments-9.rs index 4dd6c5eb4e6..d0eeebd02f8 100644 --- a/src/test/compile-fail/move-fragments-9.rs +++ b/src/test/compile-fail/move-fragments-9.rs @@ -34,7 +34,7 @@ pub fn test_move_array_into_recv(a: [D; 3], recv: &mut [D; 3]) { } #[rustc_move_fragments] -pub fn test_extract_array_elem(a: [D; 3], i: uint) -> D { +pub fn test_extract_array_elem(a: [D; 3], i: usize) -> D { //~^ ERROR parent_of_fragments: `$(local a)` //~| ERROR assigned_leaf_path: `$(local i)` //~| ERROR moved_leaf_path: `$(local a).[]` @@ -43,7 +43,7 @@ pub fn test_extract_array_elem(a: [D; 3], i: uint) -> D { } #[rustc_move_fragments] -pub fn test_overwrite_array_elem(mut a: [D; 3], i: uint, d: D) { +pub fn test_overwrite_array_elem(mut a: [D; 3], i: usize, d: D) { //~^ ERROR parent_of_fragments: `$(local mut a)` //~| ERROR assigned_leaf_path: `$(local i)` //~| ERROR assigned_leaf_path: `$(local d)` @@ -59,7 +59,7 @@ pub fn test_overwrite_array_elem(mut a: [D; 3], i: uint, d: D) { // See RFC PR 320 for more discussion. #[rustc_move_fragments] -pub fn test_move_array_then_overwrite_elem1(mut a: [D; 3], i: uint, recv: &mut [D; 3], d: D) { +pub fn test_move_array_then_overwrite_elem1(mut a: [D; 3], i: usize, recv: &mut [D; 3], d: D) { //~^ ERROR parent_of_fragments: `$(local mut a)` //~| ERROR parent_of_fragments: `$(local recv)` //~| ERROR assigned_leaf_path: `$(local recv).*` @@ -76,7 +76,7 @@ pub fn test_move_array_then_overwrite_elem1(mut a: [D; 3], i: uint, recv: &mut [ } #[rustc_move_fragments] -pub fn test_move_array_then_overwrite_elem2(mut a: [D; 3], i: uint, j: uint, +pub fn test_move_array_then_overwrite_elem2(mut a: [D; 3], i: usize, j: usize, recv: &mut [D; 3], d1: D, d2: D) { //~^^ ERROR parent_of_fragments: `$(local mut a)` //~| ERROR parent_of_fragments: `$(local recv)` diff --git a/src/test/compile-fail/moves-based-on-type-move-out-of-closure-env-issue-1965.rs b/src/test/compile-fail/moves-based-on-type-move-out-of-closure-env-issue-1965.rs index 0f5e012ef19..5dfe7f0c71f 100644 --- a/src/test/compile-fail/moves-based-on-type-move-out-of-closure-env-issue-1965.rs +++ b/src/test/compile-fail/moves-based-on-type-move-out-of-closure-env-issue-1965.rs @@ -10,9 +10,9 @@ #![feature(box_syntax)] -use std::uint; +use std::usize; -fn test(_x: Box<uint>) {} +fn test(_x: Box<usize>) {} fn main() { let i = box 3; diff --git a/src/test/compile-fail/mutable-class-fields-2.rs b/src/test/compile-fail/mutable-class-fields-2.rs index 3d8b095cb4e..708affe30f3 100644 --- a/src/test/compile-fail/mutable-class-fields-2.rs +++ b/src/test/compile-fail/mutable-class-fields-2.rs @@ -9,7 +9,7 @@ // except according to those terms. struct cat { - meows : uint, + meows : usize, how_hungry : isize, } @@ -21,7 +21,7 @@ impl cat { } -fn cat(in_x : uint, in_y : isize) -> cat { +fn cat(in_x : usize, in_y : isize) -> cat { cat { meows: in_x, how_hungry: in_y diff --git a/src/test/compile-fail/mutable-class-fields.rs b/src/test/compile-fail/mutable-class-fields.rs index b2a76d8fd37..15046c4c51b 100644 --- a/src/test/compile-fail/mutable-class-fields.rs +++ b/src/test/compile-fail/mutable-class-fields.rs @@ -9,11 +9,11 @@ // except according to those terms. struct cat { - meows : uint, + meows : usize, how_hungry : isize, } -fn cat(in_x : uint, in_y : isize) -> cat { +fn cat(in_x : usize, in_y : isize) -> cat { cat { meows: in_x, how_hungry: in_y diff --git a/src/test/compile-fail/non-constant-enum-for-vec-repeat.rs b/src/test/compile-fail/non-constant-enum-for-vec-repeat.rs index a1dc2ab2041..0212adff305 100644 --- a/src/test/compile-fail/non-constant-enum-for-vec-repeat.rs +++ b/src/test/compile-fail/non-constant-enum-for-vec-repeat.rs @@ -11,6 +11,6 @@ enum State { ST_NULL, ST_WHITESPACE } fn main() { - [State::ST_NULL; (State::ST_WHITESPACE as uint)]; + [State::ST_NULL; (State::ST_WHITESPACE as usize)]; //~^ ERROR expected constant integer for repeat count, found non-constant expression } diff --git a/src/test/compile-fail/non-constant-expr-for-vec-repeat.rs b/src/test/compile-fail/non-constant-expr-for-vec-repeat.rs index 2e063e5237c..26528543b43 100644 --- a/src/test/compile-fail/non-constant-expr-for-vec-repeat.rs +++ b/src/test/compile-fail/non-constant-expr-for-vec-repeat.rs @@ -11,7 +11,7 @@ // Check that non constant exprs fail for vector repeat syntax fn main() { - fn bar(n: uint) { + fn bar(n: usize) { let _x = [0; n]; //~ ERROR expected constant integer for repeat count, found variable } } diff --git a/src/test/compile-fail/non-exhaustive-pattern-witness.rs b/src/test/compile-fail/non-exhaustive-pattern-witness.rs index d35e3ad3c55..7442900c9b7 100644 --- a/src/test/compile-fail/non-exhaustive-pattern-witness.rs +++ b/src/test/compile-fail/non-exhaustive-pattern-witness.rs @@ -12,7 +12,7 @@ struct Foo { first: bool, - second: Option<[uint; 4]> + second: Option<[usize; 4]> } enum Color { diff --git a/src/test/compile-fail/or-patter-mismatch.rs b/src/test/compile-fail/or-patter-mismatch.rs index 7f30e365609..f845d1e6344 100644 --- a/src/test/compile-fail/or-patter-mismatch.rs +++ b/src/test/compile-fail/or-patter-mismatch.rs @@ -10,6 +10,6 @@ // error-pattern: mismatched types -enum blah { a(isize, isize, uint), b(isize, isize), } +enum blah { a(isize, isize, usize), b(isize, isize), } fn main() { match blah::a(1, 1, 2u) { blah::a(_, x, y) | blah::b(x, y) => { } } } diff --git a/src/test/compile-fail/packed-struct-transmute.rs b/src/test/compile-fail/packed-struct-transmute.rs index 200c8a5137a..b80dd0b36ed 100644 --- a/src/test/compile-fail/packed-struct-transmute.rs +++ b/src/test/compile-fail/packed-struct-transmute.rs @@ -20,13 +20,13 @@ use std::mem; #[repr(packed)] struct Foo { bar: u8, - baz: uint + baz: usize } #[derive(Show)] struct Oof { rab: u8, - zab: uint + zab: usize } fn main() { diff --git a/src/test/compile-fail/pat-shadow-in-nested-binding.rs b/src/test/compile-fail/pat-shadow-in-nested-binding.rs index 4d89ec14d94..526e4c16187 100644 --- a/src/test/compile-fail/pat-shadow-in-nested-binding.rs +++ b/src/test/compile-fail/pat-shadow-in-nested-binding.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct foo(uint); +struct foo(usize); fn main() { let (foo, _) = (2, 3); //~ ERROR declaration of `foo` shadows diff --git a/src/test/compile-fail/prim-with-args.rs b/src/test/compile-fail/prim-with-args.rs index b4dba4f3a60..cc0b74dc82a 100644 --- a/src/test/compile-fail/prim-with-args.rs +++ b/src/test/compile-fail/prim-with-args.rs @@ -15,7 +15,7 @@ let x: i8<isize>; //~ ERROR type parameters are not allowed on this type let x: i16<isize>; //~ ERROR type parameters are not allowed on this type let x: i32<isize>; //~ ERROR type parameters are not allowed on this type let x: i64<isize>; //~ ERROR type parameters are not allowed on this type -let x: uint<isize>; //~ ERROR type parameters are not allowed on this type +let x: usize<isize>; //~ ERROR type parameters are not allowed on this type let x: u8<isize>; //~ ERROR type parameters are not allowed on this type let x: u16<isize>; //~ ERROR type parameters are not allowed on this type let x: u32<isize>; //~ ERROR type parameters are not allowed on this type @@ -27,7 +27,7 @@ let x: i8<'static>; //~ ERROR lifetime parameters are not allowed on this type let x: i16<'static>; //~ ERROR lifetime parameters are not allowed on this type let x: i32<'static>; //~ ERROR lifetime parameters are not allowed on this type let x: i64<'static>; //~ ERROR lifetime parameters are not allowed on this type -let x: uint<'static>; //~ ERROR lifetime parameters are not allowed on this type +let x: usize<'static>; //~ ERROR lifetime parameters are not allowed on this type let x: u8<'static>; //~ ERROR lifetime parameters are not allowed on this type let x: u16<'static>; //~ ERROR lifetime parameters are not allowed on this type let x: u32<'static>; //~ ERROR lifetime parameters are not allowed on this type diff --git a/src/test/compile-fail/private-method.rs b/src/test/compile-fail/private-method.rs index d09481cfd64..f897a2bc9f3 100644 --- a/src/test/compile-fail/private-method.rs +++ b/src/test/compile-fail/private-method.rs @@ -12,7 +12,7 @@ mod kitties { pub struct cat { - meows : uint, + meows : usize, how_hungry : isize, } @@ -21,7 +21,7 @@ mod kitties { fn nap(&self) {} } - pub fn cat(in_x : uint, in_y : isize) -> cat { + pub fn cat(in_x : usize, in_y : isize) -> cat { cat { meows: in_x, how_hungry: in_y diff --git a/src/test/compile-fail/private-struct-field.rs b/src/test/compile-fail/private-struct-field.rs index 3f6fa573cc0..b98719e157e 100644 --- a/src/test/compile-fail/private-struct-field.rs +++ b/src/test/compile-fail/private-struct-field.rs @@ -10,7 +10,7 @@ mod cat { pub struct Cat { - meows: uint + meows: usize } pub fn new_cat() -> Cat { diff --git a/src/test/compile-fail/recursion_limit.rs b/src/test/compile-fail/recursion_limit.rs index 6e1ecb10e3a..6cd984c071a 100644 --- a/src/test/compile-fail/recursion_limit.rs +++ b/src/test/compile-fail/recursion_limit.rs @@ -35,7 +35,7 @@ link! { K, L } link! { L, M } link! { M, N } -enum N { N(uint) } +enum N { N(usize) } fn is_send<T:Send>() { } diff --git a/src/test/compile-fail/region-bound-on-closure-outlives-call.rs b/src/test/compile-fail/region-bound-on-closure-outlives-call.rs index 9e8281faf2f..5b04fa3d87c 100644 --- a/src/test/compile-fail/region-bound-on-closure-outlives-call.rs +++ b/src/test/compile-fail/region-bound-on-closure-outlives-call.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn call_rec<F>(mut f: F) -> uint where F: FnMut(uint) -> uint { +fn call_rec<F>(mut f: F) -> usize where F: FnMut(usize) -> usize { (|&mut: x| f(x))(call_rec(f)) //~ ERROR cannot move out of `f` } diff --git a/src/test/compile-fail/regions-addr-of-self.rs b/src/test/compile-fail/regions-addr-of-self.rs index fb2dbacef84..6aeac1bd1b3 100644 --- a/src/test/compile-fail/regions-addr-of-self.rs +++ b/src/test/compile-fail/regions-addr-of-self.rs @@ -9,17 +9,17 @@ // except according to those terms. struct dog { - cats_chased: uint, + cats_chased: usize, } impl dog { pub fn chase_cat(&mut self) { - let p: &'static mut uint = &mut self.cats_chased; //~ ERROR cannot infer + let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer *p += 1u; } pub fn chase_cat_2(&mut self) { - let p: &mut uint = &mut self.cats_chased; + let p: &mut usize = &mut self.cats_chased; *p += 1u; } } 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 fb60d8f7b27..33898b2e782 100644 --- a/src/test/compile-fail/regions-addr-of-upvar-self.rs +++ b/src/test/compile-fail/regions-addr-of-upvar-self.rs @@ -8,16 +8,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::uint; +use std::usize; struct dog { - food: uint, + food: usize, } impl dog { pub fn chase_cat(&mut self) { let _f = |&:| { - let p: &'static mut uint = &mut self.food; //~ ERROR cannot infer + let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer *p = 3u; }; } diff --git a/src/test/compile-fail/regions-creating-enums.rs b/src/test/compile-fail/regions-creating-enums.rs index 1774c9fada9..2e7a4051ff2 100644 --- a/src/test/compile-fail/regions-creating-enums.rs +++ b/src/test/compile-fail/regions-creating-enums.rs @@ -9,7 +9,7 @@ // except according to those terms. enum ast<'a> { - num(uint), + num(usize), add(&'a ast<'a>, &'a ast<'a>) } @@ -20,14 +20,14 @@ fn build() { compute(&z); } -fn compute(x: &ast) -> uint { +fn compute(x: &ast) -> usize { match *x { ast::num(x) => { x } ast::add(x, y) => { compute(x) + compute(y) } } } -fn map_nums<'a,'b, F>(x: &ast, f: &mut F) -> &'a ast<'b> where F: FnMut(uint) -> uint { +fn map_nums<'a,'b, F>(x: &ast, f: &mut F) -> &'a ast<'b> where F: FnMut(usize) -> usize { match *x { ast::num(x) => { return &ast::num((*f)(x)); //~ ERROR borrowed value does not live long enough diff --git a/src/test/compile-fail/regions-creating-enums3.rs b/src/test/compile-fail/regions-creating-enums3.rs index 6f38f29591f..4c8484540aa 100644 --- a/src/test/compile-fail/regions-creating-enums3.rs +++ b/src/test/compile-fail/regions-creating-enums3.rs @@ -9,7 +9,7 @@ // except according to those terms. enum ast<'a> { - num(uint), + num(usize), add(&'a ast<'a>, &'a ast<'a>) } diff --git a/src/test/compile-fail/regions-creating-enums4.rs b/src/test/compile-fail/regions-creating-enums4.rs index 34a125c809f..5dc9b370f32 100644 --- a/src/test/compile-fail/regions-creating-enums4.rs +++ b/src/test/compile-fail/regions-creating-enums4.rs @@ -9,7 +9,7 @@ // except according to those terms. enum ast<'a> { - num(uint), + num(usize), add(&'a ast<'a>, &'a ast<'a>) } diff --git a/src/test/compile-fail/regions-free-region-ordering-callee.rs b/src/test/compile-fail/regions-free-region-ordering-callee.rs index 6e59a29b8cf..22724081a1b 100644 --- a/src/test/compile-fail/regions-free-region-ordering-callee.rs +++ b/src/test/compile-fail/regions-free-region-ordering-callee.rs @@ -12,32 +12,32 @@ // that appear in their parameter list. See also // regions-free-region-ordering-caller.rs -fn ordering1<'a, 'b>(x: &'a &'b uint) -> &'a uint { +fn ordering1<'a, 'b>(x: &'a &'b usize) -> &'a usize { // It is safe to assume that 'a <= 'b due to the type of x - let y: &'b uint = &**x; + let y: &'b usize = &**x; return y; } -fn ordering2<'a, 'b>(x: &'a &'b uint, y: &'a uint) -> &'b uint { +fn ordering2<'a, 'b>(x: &'a &'b usize, y: &'a usize) -> &'b usize { // However, it is not safe to assume that 'b <= 'a &*y //~ ERROR cannot infer } -fn ordering3<'a, 'b>(x: &'a uint, y: &'b uint) -> &'a &'b uint { +fn ordering3<'a, 'b>(x: &'a usize, y: &'b usize) -> &'a &'b usize { // Do not infer an ordering from the return value. - let z: &'b uint = &*x; + let z: &'b usize = &*x; //~^ ERROR cannot infer panic!(); } -fn ordering4<'a, 'b, F>(a: &'a uint, b: &'b uint, x: F) where F: FnOnce(&'a &'b uint) { +fn ordering4<'a, 'b, F>(a: &'a usize, b: &'b usize, x: F) where F: FnOnce(&'a &'b usize) { // Do not infer ordering from closure argument types. - let z: Option<&'a &'b uint> = None; + let z: Option<&'a &'b usize> = None; //~^ ERROR reference has a longer lifetime than the data it references } -fn ordering5<'a, 'b>(a: &'a uint, b: &'b uint, x: Option<&'a &'b uint>) { - let z: Option<&'a &'b uint> = None; +fn ordering5<'a, 'b>(a: &'a usize, b: &'b usize, x: Option<&'a &'b usize>) { + let z: Option<&'a &'b usize> = None; } fn main() {} diff --git a/src/test/compile-fail/regions-free-region-ordering-caller.rs b/src/test/compile-fail/regions-free-region-ordering-caller.rs index 55c0cf3bb26..edca3b7ed41 100644 --- a/src/test/compile-fail/regions-free-region-ordering-caller.rs +++ b/src/test/compile-fail/regions-free-region-ordering-caller.rs @@ -12,21 +12,21 @@ // than the thing it points at and ensure that they result in // errors. See also regions-free-region-ordering-callee.rs -struct Paramd<'a> { x: &'a uint } +struct Paramd<'a> { x: &'a usize } -fn call2<'a, 'b>(a: &'a uint, b: &'b uint) { - let z: Option<&'b &'a uint> = None; +fn call2<'a, 'b>(a: &'a usize, b: &'b usize) { + let z: Option<&'b &'a usize> = None; //~^ ERROR reference has a longer lifetime than the data it references } -fn call3<'a, 'b>(a: &'a uint, b: &'b uint) { +fn call3<'a, 'b>(a: &'a usize, b: &'b usize) { let y: Paramd<'a> = Paramd { x: a }; let z: Option<&'b Paramd<'a>> = None; //~^ ERROR reference has a longer lifetime than the data it references } -fn call4<'a, 'b>(a: &'a uint, b: &'b uint) { - let z: Option<&'a &'b uint> = None; +fn call4<'a, 'b>(a: &'a usize, b: &'b usize) { + let z: Option<&'a &'b usize> = None; //~^ ERROR reference has a longer lifetime than the data it references } diff --git a/src/test/compile-fail/regions-free-region-ordering-caller1.rs b/src/test/compile-fail/regions-free-region-ordering-caller1.rs index b117a1a6476..b29518ccdab 100644 --- a/src/test/compile-fail/regions-free-region-ordering-caller1.rs +++ b/src/test/compile-fail/regions-free-region-ordering-caller1.rs @@ -12,11 +12,11 @@ // than the thing it points at and ensure that they result in // errors. See also regions-free-region-ordering-callee.rs -fn call1<'a>(x: &'a uint) { +fn call1<'a>(x: &'a usize) { // Test that creating a pointer like - // &'a &'z uint requires that 'a <= 'z: - let y: uint = 3; - let z: &'a & uint = &(&y); + // &'a &'z usize requires that 'a <= 'z: + let y: usize = 3; + let z: &'a & usize = &(&y); //~^ ERROR borrowed value does not live long enough //~^^ ERROR `y` does not live long enough } diff --git a/src/test/compile-fail/regions-glb-free-free.rs b/src/test/compile-fail/regions-glb-free-free.rs index 0eb47da16b6..f43d35c579e 100644 --- a/src/test/compile-fail/regions-glb-free-free.rs +++ b/src/test/compile-fail/regions-glb-free-free.rs @@ -12,8 +12,8 @@ mod argparse { pub struct Flag<'a> { name: &'a str, desc: &'a str, - max_count: uint, - value: uint + max_count: usize, + value: usize } pub fn flag<'r>(name: &'r str, desc: &'r str) -> Flag<'r> { diff --git a/src/test/compile-fail/regions-in-enums.rs b/src/test/compile-fail/regions-in-enums.rs index 72b32e4a9af..613a90dda67 100644 --- a/src/test/compile-fail/regions-in-enums.rs +++ b/src/test/compile-fail/regions-in-enums.rs @@ -12,19 +12,19 @@ // See also regions-undeclared.rs enum yes0<'lt> { - X3(&'lt uint) + X3(&'lt usize) } enum yes1<'a> { - X4(&'a uint) + X4(&'a usize) } enum no0 { - X5(&'foo uint) //~ ERROR use of undeclared lifetime name `'foo` + X5(&'foo usize) //~ ERROR use of undeclared lifetime name `'foo` } enum no1 { - X6(&'a uint) //~ ERROR use of undeclared lifetime name `'a` + X6(&'a usize) //~ ERROR use of undeclared lifetime name `'a` } fn main() {} diff --git a/src/test/compile-fail/regions-in-structs.rs b/src/test/compile-fail/regions-in-structs.rs index f46f73bf26a..c231d3a913e 100644 --- a/src/test/compile-fail/regions-in-structs.rs +++ b/src/test/compile-fail/regions-in-structs.rs @@ -9,11 +9,11 @@ // except according to those terms. struct yes1<'a> { - x: &'a uint, + x: &'a usize, } struct yes2<'a> { - x: &'a uint, + x: &'a usize, } struct StructDecl { diff --git a/src/test/compile-fail/regions-trait-1.rs b/src/test/compile-fail/regions-trait-1.rs index 32d89607e4b..d5ef9f3a964 100644 --- a/src/test/compile-fail/regions-trait-1.rs +++ b/src/test/compile-fail/regions-trait-1.rs @@ -10,7 +10,7 @@ #![feature(box_syntax)] -struct ctxt { v: uint } +struct ctxt { v: usize } trait get_ctxt { // Here the `&` is bound in the method definition: @@ -29,7 +29,7 @@ impl<'a> get_ctxt for has_ctxt<'a> { } -fn get_v(gc: Box<get_ctxt>) -> uint { +fn get_v(gc: Box<get_ctxt>) -> usize { gc.get_ctxt().v } diff --git a/src/test/compile-fail/regions-trait-2.rs b/src/test/compile-fail/regions-trait-2.rs index 92c1849c15b..0f298492e61 100644 --- a/src/test/compile-fail/regions-trait-2.rs +++ b/src/test/compile-fail/regions-trait-2.rs @@ -13,7 +13,7 @@ // Test that you cannot escape a reference // into a trait. -struct ctxt { v: uint } +struct ctxt { v: usize } trait get_ctxt { fn get_ctxt(&self) -> &'a ctxt; diff --git a/src/test/compile-fail/regions-trait-3.rs b/src/test/compile-fail/regions-trait-3.rs index 78d84fb7c75..8943abb49ae 100644 --- a/src/test/compile-fail/regions-trait-3.rs +++ b/src/test/compile-fail/regions-trait-3.rs @@ -22,7 +22,7 @@ // except according to those terms. trait get_ctxt<'a> { - fn get_ctxt(self) -> &'a uint; + fn get_ctxt(self) -> &'a usize; } fn make_gc1(gc: @get_ctxt<'a>) -> @get_ctxt<'b> { @@ -30,11 +30,11 @@ fn make_gc1(gc: @get_ctxt<'a>) -> @get_ctxt<'b> { } struct Foo { - r: &'a uint + r: &'a usize } impl get_ctxt for Foo<'a> { - fn get_ctxt(&self) -> &'a uint { self.r } + fn get_ctxt(&self) -> &'a usize { self.r } } fn make_gc2<'a,'b>(foo: Foo<'a>) -> @get_ctxt<'b> { diff --git a/src/test/compile-fail/std-uncopyable-atomics.rs b/src/test/compile-fail/std-uncopyable-atomics.rs index 5ebabc2e354..c1affeca8d9 100644 --- a/src/test/compile-fail/std-uncopyable-atomics.rs +++ b/src/test/compile-fail/std-uncopyable-atomics.rs @@ -21,6 +21,6 @@ fn main() { let x = *&x; //~ ERROR: cannot move out of dereference let x = ATOMIC_UINT_INIT; let x = *&x; //~ ERROR: cannot move out of dereference - let x: AtomicPtr<uint> = AtomicPtr::new(ptr::null_mut()); + let x: AtomicPtr<usize> = AtomicPtr::new(ptr::null_mut()); let x = *&x; //~ ERROR: cannot move out of dereference } diff --git a/src/test/compile-fail/struct-pat-derived-error.rs b/src/test/compile-fail/struct-pat-derived-error.rs index cafead3af0e..4b65292340f 100644 --- a/src/test/compile-fail/struct-pat-derived-error.rs +++ b/src/test/compile-fail/struct-pat-derived-error.rs @@ -9,8 +9,8 @@ // except according to those terms. struct a { - b: uint, - c: uint + b: usize, + c: usize } impl a { diff --git a/src/test/compile-fail/tail-typeck.rs b/src/test/compile-fail/tail-typeck.rs index aeb01c93ed0..99e98b24b63 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() -> uint { return 0u; } +fn g() -> usize { return 0u; } fn main() { let y = f(); } diff --git a/src/test/compile-fail/terr-in-field.rs b/src/test/compile-fail/terr-in-field.rs index 975c7e7de1f..1e5422a798e 100644 --- a/src/test/compile-fail/terr-in-field.rs +++ b/src/test/compile-fail/terr-in-field.rs @@ -15,7 +15,7 @@ struct foo { struct bar { a: isize, - b: uint, + b: usize, } fn want_foo(f: foo) {} diff --git a/src/test/compile-fail/trait-bounds-on-structs-and-enums-locals.rs b/src/test/compile-fail/trait-bounds-on-structs-and-enums-locals.rs index 52035c09dd6..479f21ea3a1 100644 --- a/src/test/compile-fail/trait-bounds-on-structs-and-enums-locals.rs +++ b/src/test/compile-fail/trait-bounds-on-structs-and-enums-locals.rs @@ -20,7 +20,7 @@ fn main() { x: 3i }; - let baz: Foo<uint> = panic!(); + let baz: Foo<usize> = panic!(); //~^ ERROR not implemented } diff --git a/src/test/compile-fail/trait-bounds-on-structs-and-enums-static.rs b/src/test/compile-fail/trait-bounds-on-structs-and-enums-static.rs index c26cccc8b14..d5369817e9a 100644 --- a/src/test/compile-fail/trait-bounds-on-structs-and-enums-static.rs +++ b/src/test/compile-fail/trait-bounds-on-structs-and-enums-static.rs @@ -14,7 +14,7 @@ struct Foo<T:Trait> { x: T, } -static X: Foo<uint> = Foo { +static X: Foo<usize> = Foo { //~^ ERROR not implemented x: 1, }; diff --git a/src/test/compile-fail/trait-bounds-on-structs-and-enums-xc.rs b/src/test/compile-fail/trait-bounds-on-structs-and-enums-xc.rs index d01f9d59fb4..ded75aa1d85 100644 --- a/src/test/compile-fail/trait-bounds-on-structs-and-enums-xc.rs +++ b/src/test/compile-fail/trait-bounds-on-structs-and-enums-xc.rs @@ -14,7 +14,7 @@ extern crate trait_bounds_on_structs_and_enums_xc; use trait_bounds_on_structs_and_enums_xc::{Bar, Foo, Trait}; -fn explode(x: Foo<uint>) {} +fn explode(x: Foo<usize>) {} //~^ ERROR not implemented fn kaboom(y: Bar<f32>) {} diff --git a/src/test/compile-fail/trait-bounds-on-structs-and-enums.rs b/src/test/compile-fail/trait-bounds-on-structs-and-enums.rs index 87d32a0041d..490ee0e8ad6 100644 --- a/src/test/compile-fail/trait-bounds-on-structs-and-enums.rs +++ b/src/test/compile-fail/trait-bounds-on-structs-and-enums.rs @@ -17,7 +17,7 @@ struct Foo<T:Trait> { enum Bar<T:Trait> { ABar(isize), BBar(T), - CBar(uint), + CBar(usize), } fn explode(x: Foo<u32>) {} @@ -38,7 +38,7 @@ struct Baz { enum Boo { //~^ ERROR not implemented - Quux(Bar<uint>), + Quux(Bar<usize>), } struct Badness<U> { @@ -57,7 +57,7 @@ trait PolyTrait<T> { struct Struct; -impl PolyTrait<Foo<uint>> for Struct { +impl PolyTrait<Foo<usize>> for Struct { //~^ ERROR not implemented fn whatever() {} } diff --git a/src/test/compile-fail/trait-impl-different-num-params.rs b/src/test/compile-fail/trait-impl-different-num-params.rs index 6c3e9879441..647dd4e05fa 100644 --- a/src/test/compile-fail/trait-impl-different-num-params.rs +++ b/src/test/compile-fail/trait-impl-different-num-params.rs @@ -9,7 +9,7 @@ // except according to those terms. trait foo { - fn bar(&self, x: uint) -> Self; + fn bar(&self, x: usize) -> Self; } impl foo for isize { fn bar(&self) -> isize { diff --git a/src/test/compile-fail/trait-impl-method-mismatch.rs b/src/test/compile-fail/trait-impl-method-mismatch.rs index 73224c7b45c..4e2eb224213 100644 --- a/src/test/compile-fail/trait-impl-method-mismatch.rs +++ b/src/test/compile-fail/trait-impl-method-mismatch.rs @@ -10,12 +10,12 @@ trait Mumbo { - fn jumbo(&self, x: &uint) -> uint; + fn jumbo(&self, x: &usize) -> usize; } -impl Mumbo for uint { +impl Mumbo for usize { // Cannot have a larger effect than the trait: - unsafe fn jumbo(&self, x: &uint) { *self + *x; } + unsafe fn jumbo(&self, x: &usize) { *self + *x; } //~^ ERROR expected normal fn, found unsafe fn } diff --git a/src/test/compile-fail/trait-test-2.rs b/src/test/compile-fail/trait-test-2.rs index f1ff82662b9..583d0421d1e 100644 --- a/src/test/compile-fail/trait-test-2.rs +++ b/src/test/compile-fail/trait-test-2.rs @@ -12,7 +12,7 @@ trait bar { fn dup(&self) -> Self; fn blah<X>(&self); } impl bar for isize { fn dup(&self) -> isize { *self } fn blah<X>(&self) {} } -impl bar for uint { fn dup(&self) -> uint { *self } fn blah<X>(&self) {} } +impl bar for usize { fn dup(&self) -> usize { *self } fn blah<X>(&self) {} } fn main() { 10i.dup::<isize>(); //~ ERROR does not take type parameters diff --git a/src/test/compile-fail/trait-test.rs b/src/test/compile-fail/trait-test.rs index 6039e646407..d53e353d9d9 100644 --- a/src/test/compile-fail/trait-test.rs +++ b/src/test/compile-fail/trait-test.rs @@ -10,6 +10,6 @@ trait foo { fn foo(&self); } -impl isize for uint { fn foo(&self) {} } //~ ERROR trait +impl isize for usize { fn foo(&self) {} } //~ ERROR trait fn main() {} diff --git a/src/test/compile-fail/traits-multidispatch-bad.rs b/src/test/compile-fail/traits-multidispatch-bad.rs index d155735d69c..f655844e2f3 100644 --- a/src/test/compile-fail/traits-multidispatch-bad.rs +++ b/src/test/compile-fail/traits-multidispatch-bad.rs @@ -14,9 +14,9 @@ trait Convert<Target> { fn convert(&self) -> Target; } -impl Convert<uint> for isize { - fn convert(&self) -> uint { - *self as uint +impl Convert<usize> for isize { + fn convert(&self) -> usize { + *self as usize } } diff --git a/src/test/compile-fail/typeck_type_placeholder_item.rs b/src/test/compile-fail/typeck_type_placeholder_item.rs index 723c5fda3a7..aa4ecad6393 100644 --- a/src/test/compile-fail/typeck_type_placeholder_item.rs +++ b/src/test/compile-fail/typeck_type_placeholder_item.rs @@ -31,7 +31,7 @@ static TEST5: (_, _) = (1, 2); fn test6(_: _) { } //~^ ERROR the type placeholder `_` is not allowed within types on item signatures -fn test7(x: _) { let _x: uint = x; } +fn test7(x: _) { let _x: usize = x; } //~^ ERROR the type placeholder `_` is not allowed within types on item signatures fn test8(_f: fn() -> _) { } @@ -84,7 +84,7 @@ pub fn main() { fn fn_test6(_: _) { } //~^ ERROR the type placeholder `_` is not allowed within types on item signatures - fn fn_test7(x: _) { let _x: uint = x; } + fn fn_test7(x: _) { let _x: usize = x; } //~^ ERROR the type placeholder `_` is not allowed within types on item signatures fn fn_test8(_f: fn() -> _) { } diff --git a/src/test/compile-fail/typeck_type_placeholder_lifetime_2.rs b/src/test/compile-fail/typeck_type_placeholder_lifetime_2.rs index 365b786cc1a..8178335de59 100644 --- a/src/test/compile-fail/typeck_type_placeholder_lifetime_2.rs +++ b/src/test/compile-fail/typeck_type_placeholder_lifetime_2.rs @@ -16,6 +16,6 @@ struct Foo<'a, T:'a> { } pub fn main() { - let c: Foo<_, uint> = Foo { r: &5 }; + let c: Foo<_, usize> = Foo { r: &5 }; //~^ ERROR wrong number of type arguments: expected 1, found 2 } diff --git a/src/test/compile-fail/ufcs-explicit-self-bad.rs b/src/test/compile-fail/ufcs-explicit-self-bad.rs index 60b2002ae97..6c323e8c1ae 100644 --- a/src/test/compile-fail/ufcs-explicit-self-bad.rs +++ b/src/test/compile-fail/ufcs-explicit-self-bad.rs @@ -28,7 +28,7 @@ impl<T> Bar<T> { fn foo(self: Bar<isize>, x: isize) -> isize { //~ ERROR mismatched self type x } - fn bar(self: &Bar<uint>, x: isize) -> isize { //~ ERROR mismatched self type + fn bar(self: &Bar<usize>, x: isize) -> isize { //~ ERROR mismatched self type x } } diff --git a/src/test/compile-fail/unboxed-closure-immutable-capture.rs b/src/test/compile-fail/unboxed-closure-immutable-capture.rs index e28abaf2b1f..3848f07a089 100644 --- a/src/test/compile-fail/unboxed-closure-immutable-capture.rs +++ b/src/test/compile-fail/unboxed-closure-immutable-capture.rs @@ -14,7 +14,7 @@ // environment cannot mutate captured variables that have not been // declared mutable (#18335) -fn set(x: &mut uint) { *x = 0; } +fn set(x: &mut usize) { *x = 0; } fn main() { let x = 0u; diff --git a/src/test/compile-fail/unboxed-closure-sugar-equiv.rs b/src/test/compile-fail/unboxed-closure-sugar-equiv.rs index f37dcfb7745..9dff0e9e01e 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-equiv.rs +++ b/src/test/compile-fail/unboxed-closure-sugar-equiv.rs @@ -28,21 +28,21 @@ fn test<'a,'b>() { // No errors expected: eq::< Foo<(),()>, Foo() >(); eq::< Foo<(isize,),()>, Foo(isize) >(); - eq::< Foo<(isize,uint),()>, Foo(isize,uint) >(); - eq::< Foo<(isize,uint),uint>, Foo(isize,uint) -> uint >(); - eq::< Foo<(&'a isize,&'b uint),uint>, Foo(&'a isize,&'b uint) -> uint >(); + eq::< Foo<(isize,usize),()>, Foo(isize,usize) >(); + eq::< Foo<(isize,usize),usize>, Foo(isize,usize) -> usize >(); + eq::< Foo<(&'a isize,&'b usize),usize>, Foo(&'a isize,&'b usize) -> usize >(); // Test that anonymous regions in `()` form are equivalent // to fresh bound regions, and that we can intermingle // named and anonymous as we choose: - eq::< for<'x,'y> Foo<(&'x isize,&'y uint),uint>, - for<'x,'y> Foo(&'x isize,&'y uint) -> uint >(); - eq::< for<'x,'y> Foo<(&'x isize,&'y uint),uint>, - for<'x> Foo(&'x isize,&uint) -> uint >(); - eq::< for<'x,'y> Foo<(&'x isize,&'y uint),uint>, - for<'y> Foo(&isize,&'y uint) -> uint >(); - eq::< for<'x,'y> Foo<(&'x isize,&'y uint),uint>, - Foo(&isize,&uint) -> uint >(); + eq::< for<'x,'y> Foo<(&'x isize,&'y usize),usize>, + for<'x,'y> Foo(&'x isize,&'y usize) -> usize >(); + eq::< for<'x,'y> Foo<(&'x isize,&'y usize),usize>, + for<'x> Foo(&'x isize,&usize) -> usize >(); + eq::< for<'x,'y> Foo<(&'x isize,&'y usize),usize>, + for<'y> Foo(&isize,&'y usize) -> usize >(); + eq::< for<'x,'y> Foo<(&'x isize,&'y usize),usize>, + Foo(&isize,&usize) -> usize >(); // lifetime elision eq::< for<'x> Foo<(&'x isize,), &'x isize>, diff --git a/src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs b/src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs index 176970703c5..29429c708d2 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs +++ b/src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs @@ -30,5 +30,5 @@ fn main() { eq::< for<'a> Foo<(&'a isize,), (&'a isize, &'a isize)>, Foo(&isize) -> (&isize, &isize) >(); - let _: Foo(&isize, &uint) -> &uint; //~ ERROR missing lifetime specifier + let _: Foo(&isize, &usize) -> &usize; //~ ERROR missing lifetime specifier } diff --git a/src/test/compile-fail/unboxed-closure-sugar-used-on-struct-3.rs b/src/test/compile-fail/unboxed-closure-sugar-used-on-struct-3.rs index b2bd030f3c4..d86f55d5368 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-used-on-struct-3.rs +++ b/src/test/compile-fail/unboxed-closure-sugar-used-on-struct-3.rs @@ -19,7 +19,7 @@ impl<A,B> Bar<A,B> { } fn bar() { - let b = Box::Bar::<isize,uint>::new(); // OK + let b = Box::Bar::<isize,usize>::new(); // OK let b = Box::Bar::()::new(); //~^ ERROR expected ident, found `(` diff --git a/src/test/compile-fail/unboxed-closures-vtable-mismatch.rs b/src/test/compile-fail/unboxed-closures-vtable-mismatch.rs index ca641e39aed..95673a51319 100644 --- a/src/test/compile-fail/unboxed-closures-vtable-mismatch.rs +++ b/src/test/compile-fail/unboxed-closures-vtable-mismatch.rs @@ -17,7 +17,7 @@ fn call_it<F:FnMut<(isize,isize),isize>>(y: isize, mut f: F) -> isize { } pub fn main() { - let f = |&mut: x: uint, y: isize| -> isize { (x as isize) + y }; + let f = |&mut: x: usize, y: isize| -> isize { (x as isize) + y }; let z = call_it(3, f); //~ ERROR type mismatch println!("{}", z); } diff --git a/src/test/compile-fail/unreachable-arm.rs b/src/test/compile-fail/unreachable-arm.rs index c4c0e648f34..c277e63aba9 100644 --- a/src/test/compile-fail/unreachable-arm.rs +++ b/src/test/compile-fail/unreachable-arm.rs @@ -12,6 +12,6 @@ #![feature(box_syntax)] -enum foo { a(Box<foo>, isize), b(uint), } +enum foo { a(Box<foo>, isize), b(usize), } fn main() { match foo::b(1u) { foo::b(_) | foo::a(box _, 1) => { } foo::a(_, 1) => { } } } diff --git a/src/test/compile-fail/unsized5.rs b/src/test/compile-fail/unsized5.rs index 02a8b5899d7..dc10f795cd4 100644 --- a/src/test/compile-fail/unsized5.rs +++ b/src/test/compile-fail/unsized5.rs @@ -21,11 +21,11 @@ struct S2<X: ?Sized> { } struct S3 { f: str, //~ ERROR `core::marker::Sized` is not implemented - g: [uint] + g: [usize] } struct S4 { f: str, //~ ERROR `core::marker::Sized` is not implemented - g: uint + g: usize } enum E<X: ?Sized> { V1(X, isize), //~ERROR `core::marker::Sized` is not implemented diff --git a/src/test/compile-fail/utf8_idents.rs b/src/test/compile-fail/utf8_idents.rs index 9bd14305b9a..a5471e87f22 100644 --- a/src/test/compile-fail/utf8_idents.rs +++ b/src/test/compile-fail/utf8_idents.rs @@ -16,7 +16,7 @@ fn foo< >() {} struct X { - δ: uint //~ ERROR non-ascii idents are not fully supported + δ: usize //~ ERROR non-ascii idents are not fully supported } pub fn main() { diff --git a/src/test/compile-fail/variadic-ffi-2.rs b/src/test/compile-fail/variadic-ffi-2.rs index 9e2b015f33d..1d519c978a3 100644 --- a/src/test/compile-fail/variadic-ffi-2.rs +++ b/src/test/compile-fail/variadic-ffi-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn baz(f: extern "stdcall" fn(uint, ...)) { +fn baz(f: extern "stdcall" fn(usize, ...)) { //~^ ERROR: variadic function must have C calling convention f(22, 44); } diff --git a/src/test/compile-fail/wrong-ret-type.rs b/src/test/compile-fail/wrong-ret-type.rs index d744ad804e7..6db11fcffd2 100644 --- a/src/test/compile-fail/wrong-ret-type.rs +++ b/src/test/compile-fail/wrong-ret-type.rs @@ -9,5 +9,5 @@ // except according to those terms. // error-pattern: mismatched types -fn mk_int() -> uint { let i: isize = 3; return i; } +fn mk_int() -> usize { let i: isize = 3; return i; } fn main() { } |
