Skip to content

Commit 85f961e

Browse files
huonwnikomatsakis
authored andcommitted
Update compile fail tests to use usize.
1 parent 0c70ce1 commit 85f961e

File tree

162 files changed

+325
-325
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+325
-325
lines changed

src/test/compile-fail/assign-to-method.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
struct cat {
12-
meows : uint,
12+
meows : usize,
1313

1414
how_hungry : isize,
1515
}
@@ -18,7 +18,7 @@ impl cat {
1818
pub fn speak(&self) { self.meows += 1u; }
1919
}
2020

21-
fn cat(in_x : uint, in_y : isize) -> cat {
21+
fn cat(in_x : usize, in_y : isize) -> cat {
2222
cat {
2323
meows: in_x,
2424
how_hungry: in_y

src/test/compile-fail/associated-types-eq-2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ pub trait Foo {
1919
struct Bar;
2020

2121
impl Foo for isize {
22-
type A = uint;
23-
fn boo(&self) -> uint { 42 }
22+
type A = usize;
23+
fn boo(&self) -> usize { 42 }
2424
}
2525

2626
fn baz<I: Foo>(x: &<I as Foo<A=Bar>>::A) {}

src/test/compile-fail/associated-types-eq-3.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ pub trait Foo {
1919
struct Bar;
2020

2121
impl Foo for isize {
22-
type A = uint;
23-
fn boo(&self) -> uint {
22+
type A = usize;
23+
fn boo(&self) -> usize {
2424
42
2525
}
2626
}

src/test/compile-fail/associated-types-eq-expr-path.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ trait Foo {
1616
}
1717

1818
impl Foo for isize {
19-
type A = uint;
19+
type A = usize;
2020
fn bar() -> isize { 42 }
2121
}
2222

2323
pub fn main() {
24-
let x: isize = Foo::<A=uint>::bar();
24+
let x: isize = Foo::<A=usize>::bar();
2525
//~^ERROR unexpected binding of associated item in expression path
2626
}

src/test/compile-fail/associated-types-eq-hr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ struct UintStruct {
3333
}
3434

3535
impl<'a> TheTrait<&'a isize> for UintStruct {
36-
type A = &'a uint;
36+
type A = &'a usize;
3737

38-
fn get(&self, t: &'a isize) -> &'a uint {
38+
fn get(&self, t: &'a isize) -> &'a usize {
3939
panic!()
4040
}
4141
}
@@ -47,7 +47,7 @@ fn foo<T>()
4747
}
4848

4949
fn bar<T>()
50-
where T : for<'x> TheTrait<&'x isize, A = &'x uint>
50+
where T : for<'x> TheTrait<&'x isize, A = &'x usize>
5151
{
5252
// ok for UintStruct, but not IntStruct
5353
}

src/test/compile-fail/associated-types-incomplete-object.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ pub trait Foo {
2020
struct Bar;
2121

2222
impl Foo for isize {
23-
type A = uint;
23+
type A = usize;
2424
type B = char;
25-
fn boo(&self) -> uint {
25+
fn boo(&self) -> usize {
2626
42
2727
}
2828
}
2929

3030
pub fn main() {
31-
let a = &42i as &Foo<A=uint, B=char>;
31+
let a = &42i as &Foo<A=usize, B=char>;
3232

33-
let b = &42i as &Foo<A=uint>;
33+
let b = &42i as &Foo<A=usize>;
3434
//~^ ERROR the value of the associated type `B` (from the trait `Foo`) must be specified
3535

3636
let c = &42i as &Foo<B=char>;

src/test/compile-fail/associated-types-path-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub trait Foo {
1515
}
1616

1717
impl Foo for isize {
18-
type A = uint;
18+
type A = usize;
1919
}
2020

2121
pub fn f1<T: Foo>(a: T, x: T::A) {}

src/test/compile-fail/associated-types-unconstrained.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ trait Foo {
1616
}
1717

1818
impl Foo for isize {
19-
type A = uint;
19+
type A = usize;
2020
fn bar() -> isize { 42 }
2121
}
2222

src/test/compile-fail/bad-bang-ann-3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Tests that a function with a ! annotation always actually fails
1212

13-
fn bad_bang(i: uint) -> ! {
13+
fn bad_bang(i: usize) -> ! {
1414
return 7u; //~ ERROR `return` in a function declared as diverging [E0166]
1515
}
1616

src/test/compile-fail/bad-bang-ann.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Tests that a function with a ! annotation always actually fails
1212

13-
fn bad_bang(i: uint) -> ! { //~ ERROR computation may converge in a function marked as diverging
13+
fn bad_bang(i: usize) -> ! { //~ ERROR computation may converge in a function marked as diverging
1414
if i < 0u { } else { panic!(); }
1515
}
1616

src/test/compile-fail/bad-method-typaram-kind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ trait bar {
1616
fn bar<T:Send>(&self);
1717
}
1818

19-
impl bar for uint {
19+
impl bar for usize {
2020
fn bar<T:Send>(&self) {
2121
}
2222
}

src/test/compile-fail/borrow-immutable-upvar-mutation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// Tests that we can't assign to or mutably borrow upvars from `Fn`
1414
// closures (issue #17780)
1515

16-
fn set(x: &mut uint) { *x = 5; }
16+
fn set(x: &mut usize) { *x = 5; }
1717

1818
fn main() {
1919
// By-ref captures

src/test/compile-fail/borrowck-anon-fields-struct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// Tests that we are able to distinguish when loans borrow different
1212
// anonymous fields of a tuple vs the same anonymous field.
1313

14-
struct Y(uint, uint);
14+
struct Y(usize, usize);
1515

1616
fn distinct_variant() {
1717
let mut y = Y(1, 2);

src/test/compile-fail/borrowck-anon-fields-variant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// anonymous fields of an enum variant vs the same anonymous field.
1313

1414
enum Foo {
15-
X, Y(uint, uint)
15+
X, Y(usize, usize)
1616
}
1717

1818
fn distinct_variant() {

src/test/compile-fail/borrowck-autoref-3261.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
enum Either<T, U> { Left(T), Right(U) }
1212

13-
struct X(Either<(uint,uint), fn()>);
13+
struct X(Either<(usize,usize), fn()>);
1414

1515
impl X {
16-
pub fn with<F>(&self, blk: F) where F: FnOnce(&Either<(uint, uint), fn()>) {
16+
pub fn with<F>(&self, blk: F) where F: FnOnce(&Either<(usize, usize), fn()>) {
1717
let X(ref e) = *self;
1818
blk(e)
1919
}

src/test/compile-fail/borrowck-bad-nested-calls-free.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313

1414
#![feature(box_syntax)]
1515

16-
fn rewrite(v: &mut Box<uint>) -> uint {
16+
fn rewrite(v: &mut Box<usize>) -> usize {
1717
*v = box 22;
1818
**v
1919
}
2020

21-
fn add(v: &uint, w: uint) -> uint {
21+
fn add(v: &usize, w: usize) -> usize {
2222
*v + w
2323
}
2424

src/test/compile-fail/borrowck-bad-nested-calls-move.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313

1414
#![feature(box_syntax)]
1515

16-
fn rewrite(v: &mut Box<uint>) -> uint {
16+
fn rewrite(v: &mut Box<usize>) -> usize {
1717
*v = box 22;
1818
**v
1919
}
2020

21-
fn add(v: &uint, w: Box<uint>) -> uint {
21+
fn add(v: &usize, w: Box<usize>) -> usize {
2222
*v + *w
2323
}
2424

src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ extern crate collections;
1616
use std::collections::HashMap;
1717

1818
fn main() {
19-
let mut buggy_map: HashMap<uint, &uint> = HashMap::new();
19+
let mut buggy_map: HashMap<usize, &usize> = HashMap::new();
2020
buggy_map.insert(42, &*box 1); //~ ERROR borrowed value does not live long enough
2121

2222
// but it is ok if we use a temporary

src/test/compile-fail/borrowck-lend-flow-loop.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ fn while_aliased_mut_cond(cond: bool, cond2: bool) {
113113
}
114114
}
115115

116-
fn loop_break_pops_scopes<'r, F>(_v: &'r mut [uint], mut f: F) where
117-
F: FnMut(&'r mut uint) -> bool,
116+
fn loop_break_pops_scopes<'r, F>(_v: &'r mut [usize], mut f: F) where
117+
F: FnMut(&'r mut usize) -> bool,
118118
{
119119
// Here we check that when you break out of an inner loop, the
120120
// borrows that go out of scope as you exit the inner loop are
@@ -123,21 +123,21 @@ fn loop_break_pops_scopes<'r, F>(_v: &'r mut [uint], mut f: F) where
123123
while cond() {
124124
while cond() {
125125
// this borrow is limited to the scope of `r`...
126-
let r: &'r mut uint = produce();
126+
let r: &'r mut usize = produce();
127127
if !f(&mut *r) {
128128
break; // ...so it is not live as exit the `while` loop here
129129
}
130130
}
131131
}
132132
}
133133

134-
fn loop_loop_pops_scopes<'r, F>(_v: &'r mut [uint], mut f: F) where F: FnMut(&'r mut uint) -> bool {
134+
fn loop_loop_pops_scopes<'r, F>(_v: &'r mut [usize], mut f: F) where F: FnMut(&'r mut usize) -> bool {
135135
// Similar to `loop_break_pops_scopes` but for the `loop` keyword
136136

137137
while cond() {
138138
while cond() {
139139
// this borrow is limited to the scope of `r`...
140-
let r: &'r mut uint = produce();
140+
let r: &'r mut usize = produce();
141141
if !f(&mut *r) {
142142
continue; // ...so it is not live as exit (and re-enter) the `while` loop here
143143
}

src/test/compile-fail/borrowck-loan-in-overloaded-op.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use std::ops::Add;
1414

1515
#[derive(Clone)]
16-
struct foo(Box<uint>);
16+
struct foo(Box<usize>);
1717

1818
impl Add for foo {
1919
type Output = foo;

src/test/compile-fail/borrowck-overloaded-call.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ struct SFnOnce {
3838
x: String,
3939
}
4040

41-
impl FnOnce<(String,),uint> for SFnOnce {
42-
extern "rust-call" fn call_once(self, (z,): (String,)) -> uint {
41+
impl FnOnce<(String,),usize> for SFnOnce {
42+
extern "rust-call" fn call_once(self, (z,): (String,)) -> usize {
4343
self.x.len() + z.len()
4444
}
4545
}

src/test/compile-fail/borrowck-overloaded-index-2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ struct MyVec<T> {
1616
data: Vec<T>,
1717
}
1818

19-
impl<T> Index<uint> for MyVec<T> {
19+
impl<T> Index<usize> for MyVec<T> {
2020
type Output = T;
2121

22-
fn index(&self, &i: &uint) -> &T {
22+
fn index(&self, &i: &usize) -> &T {
2323
&self.data[i]
2424
}
2525
}

src/test/compile-fail/class-cast-to-trait.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ trait noisy {
1515
}
1616

1717
struct cat {
18-
meows : uint,
18+
meows : usize,
1919

2020
how_hungry : isize,
2121
name : String,
@@ -50,7 +50,7 @@ impl cat {
5050
}
5151
}
5252

53-
fn cat(in_x : uint, in_y : isize, in_name: String) -> cat {
53+
fn cat(in_x : usize, in_y : isize, in_name: String) -> cat {
5454
cat {
5555
meows: in_x,
5656
how_hungry: in_y,

src/test/compile-fail/class-implements-bad-trait.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
// error-pattern:nonexistent
1212
class cat : nonexistent {
13-
let meows: uint;
14-
new(in_x : uint) { self.meows = in_x; }
13+
let meows: usize;
14+
new(in_x : usize) { self.meows = in_x; }
1515
}
1616

1717
fn main() {

src/test/compile-fail/class-method-missing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ trait animal {
1313
}
1414

1515
struct cat {
16-
meows: uint,
16+
meows: usize,
1717
}
1818

1919
impl animal for cat {
2020
//~^ ERROR not all trait items implemented, missing: `eat`
2121
}
2222

23-
fn cat(in_x : uint) -> cat {
23+
fn cat(in_x : usize) -> cat {
2424
cat {
2525
meows: in_x
2626
}

src/test/compile-fail/class-missing-self.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
struct cat {
12-
meows : uint,
12+
meows : usize,
1313
}
1414

1515
impl cat {

src/test/compile-fail/coherence-blanket-conflicts-with-blanket-implemented.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::default::Default;
1616
// for the same type (though this crate doesn't).
1717

1818
trait MyTrait {
19-
fn get(&self) -> uint;
19+
fn get(&self) -> usize;
2020
}
2121

2222
trait Even { }
@@ -25,14 +25,14 @@ trait Odd { }
2525

2626
impl Even for isize { }
2727

28-
impl Odd for uint { }
28+
impl Odd for usize { }
2929

3030
impl<T:Even> MyTrait for T { //~ ERROR E0119
31-
fn get(&self) -> uint { 0 }
31+
fn get(&self) -> usize { 0 }
3232
}
3333

3434
impl<T:Odd> MyTrait for T {
35-
fn get(&self) -> uint { 0 }
35+
fn get(&self) -> usize { 0 }
3636
}
3737

3838
fn main() { }

src/test/compile-fail/coherence-blanket-conflicts-with-blanket-unimplemented.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ use std::default::Default;
1616
// for the same type (though this crate doesn't implement them at all).
1717

1818
trait MyTrait {
19-
fn get(&self) -> uint;
19+
fn get(&self) -> usize;
2020
}
2121

2222
trait Even { }
2323

2424
trait Odd { }
2525

2626
impl<T:Even> MyTrait for T { //~ ERROR E0119
27-
fn get(&self) -> uint { 0 }
27+
fn get(&self) -> usize { 0 }
2828
}
2929

3030
impl<T:Odd> MyTrait for T {
31-
fn get(&self) -> uint { 0 }
31+
fn get(&self) -> usize { 0 }
3232
}
3333

3434
fn main() { }

0 commit comments

Comments
 (0)