1
Fork 0

Update compile-fail tests to use is/us, not i/u.

This commit is contained in:
Huon Wilson 2015-01-08 22:05:56 +11:00 committed by Niko Matsakis
parent 85f961e2cc
commit 441044f071
194 changed files with 379 additions and 379 deletions

View file

@ -11,5 +11,5 @@
// Test that the old fixed length array syntax is a parsing error. // Test that the old fixed length array syntax is a parsing error.
fn main() { fn main() {
let _x: [isize, ..3] = [0i, 1, 2]; //~ ERROR let _x: [isize, ..3] = [0is, 1, 2]; //~ ERROR
} }

View file

@ -11,5 +11,5 @@
// Test that the old repeating array syntax gives an error. // Test that the old repeating array syntax gives an error.
fn main() { fn main() {
let _ = [0i, ..3]; //~ ERROR let _ = [0is, ..3]; //~ ERROR
} }

View file

@ -20,8 +20,8 @@ pub fn main() {
let x: isize; let x: isize;
let y: isize; let y: isize;
unsafe { unsafe {
asm!("mov $1, $0" : "=r"(x) : "=r"(5u)); //~ ERROR input operand constraint contains '=' asm!("mov $1, $0" : "=r"(x) : "=r"(5us)); //~ ERROR input operand constraint contains '='
asm!("mov $1, $0" : "=r"(y) : "+r"(5u)); //~ ERROR input operand constraint contains '+' asm!("mov $1, $0" : "=r"(y) : "+r"(5us)); //~ ERROR input operand constraint contains '+'
} }
foo(x); foo(x);
foo(y); foo(y);

View file

@ -21,14 +21,14 @@ pub fn main() {
let mut x: isize = 0; let mut x: isize = 0;
unsafe { unsafe {
// extra colon // extra colon
asm!("mov $1, $0" : "=r"(x) : "r"(5u), "0"(x) : : "cc"); asm!("mov $1, $0" : "=r"(x) : "r"(5us), "0"(x) : : "cc");
//~^ WARNING unrecognized option //~^ WARNING unrecognized option
} }
assert_eq!(x, 5); assert_eq!(x, 5);
unsafe { unsafe {
// comma in place of a colon // comma in place of a colon
asm!("add $2, $1; mov $1, $0" : "=r"(x) : "r"(x), "r"(8u) : "cc", "volatile"); asm!("add $2, $1; mov $1, $0" : "=r"(x) : "r"(x), "r"(8us) : "cc", "volatile");
//~^ WARNING expected a clobber, found an option //~^ WARNING expected a clobber, found an option
} }
assert_eq!(x, 13); assert_eq!(x, 13);

View file

@ -21,7 +21,7 @@ pub fn main() {
x = 1; //~ NOTE prior assignment occurs here x = 1; //~ NOTE prior assignment occurs here
foo(x); foo(x);
unsafe { unsafe {
asm!("mov $1, $0" : "=r"(x) : "r"(5u)); //~ ERROR re-assignment of immutable variable `x` asm!("mov $1, $0" : "=r"(x) : "r"(5us)); //~ ERROR re-assignment of immutable variable `x`
} }
foo(x); foo(x);
} }

View file

@ -19,7 +19,7 @@ fn foo(x: isize) { println!("{}", x); }
pub fn main() { pub fn main() {
let x: isize; let x: isize;
unsafe { unsafe {
asm!("mov $1, $0" : "r"(x) : "r"(5u)); //~ ERROR output operand constraint lacks '=' asm!("mov $1, $0" : "r"(x) : "r"(5us)); //~ ERROR output operand constraint lacks '='
} }
foo(x); foo(x);
} }

View file

@ -15,7 +15,7 @@ struct cat {
} }
impl cat { impl cat {
pub fn speak(&self) { self.meows += 1u; } pub fn speak(&self) { self.meows += 1us; }
} }
fn cat(in_x : usize, in_y : isize) -> cat { fn cat(in_x : usize, in_y : isize) -> cat {
@ -26,6 +26,6 @@ fn cat(in_x : usize, in_y : isize) -> cat {
} }
fn main() { fn main() {
let nyan : cat = cat(52u, 99); let nyan : cat = cat(52us, 99);
nyan.speak = |&:| println!("meow"); //~ ERROR attempted to take value of method nyan.speak = |&:| println!("meow"); //~ ERROR attempted to take value of method
} }

View file

@ -40,7 +40,7 @@ pub fn baz(x: &Foo<A=Bar>) {
pub fn main() { pub fn main() {
let a = 42i; let a = 42is;
foo1(a); //~ERROR expected usize, found struct Bar foo1(a); //~ERROR expected usize, found struct Bar
baz(&a); //~ERROR expected usize, found struct Bar baz(&a); //~ERROR expected usize, found struct Bar
} }

View file

@ -28,15 +28,15 @@ impl Foo for isize {
} }
pub fn main() { pub fn main() {
let a = &42i as &Foo<A=usize, B=char>; let a = &42is as &Foo<A=usize, B=char>;
let b = &42i as &Foo<A=usize>; let b = &42is as &Foo<A=usize>;
//~^ ERROR the value of the associated type `B` (from the trait `Foo`) must be specified //~^ ERROR the value of the associated type `B` (from the trait `Foo`) must be specified
let c = &42i as &Foo<B=char>; let c = &42is as &Foo<B=char>;
//~^ ERROR the value of the associated type `A` (from the trait `Foo`) must be specified //~^ ERROR the value of the associated type `A` (from the trait `Foo`) must be specified
let d = &42i as &Foo; let d = &42is as &Foo;
//~^ ERROR the value of the associated type `A` (from the trait `Foo`) must be specified //~^ ERROR the value of the associated type `A` (from the trait `Foo`) must be specified
//~| ERROR the value of the associated type `B` (from the trait `Foo`) must be specified //~| ERROR the value of the associated type `B` (from the trait `Foo`) must be specified
} }

View file

@ -11,7 +11,7 @@
// Tests that a function with a ! annotation always actually fails // Tests that a function with a ! annotation always actually fails
fn bad_bang(i: usize) -> ! { fn bad_bang(i: usize) -> ! {
return 7u; //~ ERROR `return` in a function declared as diverging [E0166] return 7us; //~ ERROR `return` in a function declared as diverging [E0166]
} }
fn main() { bad_bang(5u); } fn main() { bad_bang(5us); }

View file

@ -11,7 +11,7 @@
// Tests that a function with a ! annotation always actually fails // Tests that a function with a ! annotation always actually fails
fn bad_bang(i: usize) -> ! { //~ ERROR computation may converge in a function marked as diverging fn bad_bang(i: usize) -> ! { //~ ERROR computation may converge in a function marked as diverging
if i < 0u { } else { panic!(); } if i < 0us { } else { panic!(); }
} }
fn main() { bad_bang(5u); } fn main() { bad_bang(5us); }

View file

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

View file

@ -9,6 +9,6 @@
// except according to those terms. // except according to those terms.
fn f() -> ! { //~ ERROR computation may converge in a function marked as diverging fn f() -> ! { //~ ERROR computation may converge in a function marked as diverging
3i 3is
} }
fn main() { } fn main() { }

View file

@ -18,24 +18,24 @@ fn set(x: &mut usize) { *x = 5; }
fn main() { fn main() {
// By-ref captures // By-ref captures
{ {
let mut x = 0u; let mut x = 0us;
let _f = |&:| x = 42; //~ ERROR cannot assign let _f = |&:| x = 42; //~ ERROR cannot assign
let mut y = 0u; let mut y = 0us;
let _g = |&:| set(&mut y); //~ ERROR cannot borrow let _g = |&:| set(&mut y); //~ ERROR cannot borrow
let mut z = 0u; let mut z = 0us;
let _h = |&mut:| { set(&mut z); |&:| z = 42; }; //~ ERROR cannot assign let _h = |&mut:| { set(&mut z); |&:| z = 42; }; //~ ERROR cannot assign
} }
// By-value captures // By-value captures
{ {
let mut x = 0u; let mut x = 0us;
let _f = move |&:| x = 42; //~ ERROR cannot assign let _f = move |&:| x = 42; //~ ERROR cannot assign
let mut y = 0u; let mut y = 0us;
let _g = move |&:| set(&mut y); //~ ERROR cannot borrow let _g = move |&:| set(&mut y); //~ ERROR cannot borrow
let mut z = 0u; let mut z = 0us;
let _h = move |&mut:| { set(&mut z); move |&:| z = 42; }; //~ ERROR cannot assign let _h = move |&mut:| { set(&mut z); move |&:| z = 42; }; //~ ERROR cannot assign
} }
} }

View file

@ -16,28 +16,28 @@ struct Foo(Box<isize>, isize);
struct Bar(isize, isize); struct Bar(isize, isize);
fn main() { fn main() {
let x = (box 1i, 2i); let x = (box 1is, 2is);
let r = &x.0; let r = &x.0;
let y = x; //~ ERROR cannot move out of `x` because it is borrowed let y = x; //~ ERROR cannot move out of `x` because it is borrowed
let mut x = (1i, 2i); let mut x = (1is, 2is);
let a = &x.0; let a = &x.0;
let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable because it is also borrowed as let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable because it is also borrowed as
let mut x = (1i, 2i); let mut x = (1is, 2is);
let a = &mut x.0; let a = &mut x.0;
let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable more than once at a time let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable more than once at a time
let x = Foo(box 1i, 2i); let x = Foo(box 1is, 2is);
let r = &x.0; let r = &x.0;
let y = x; //~ ERROR cannot move out of `x` because it is borrowed let y = x; //~ ERROR cannot move out of `x` because it is borrowed
let mut x = Bar(1i, 2i); let mut x = Bar(1is, 2is);
let a = &x.0; let a = &x.0;
let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable because it is also borrowed as let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable because it is also borrowed as
let mut x = Bar(1i, 2i); let mut x = Bar(1is, 2is);
let a = &mut x.0; let a = &mut x.0;
let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable more than once at a time let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable more than once at a time
} }

View file

@ -12,7 +12,7 @@
// anonymous fields of a tuple vs the same anonymous field. // anonymous fields of a tuple vs the same anonymous field.
fn distinct_variant() { fn distinct_variant() {
let mut y = (1i, 2i); let mut y = (1is, 2is);
let a = match y { let a = match y {
(ref mut a, _) => a (ref mut a, _) => a
@ -27,7 +27,7 @@ fn distinct_variant() {
} }
fn same_variant() { fn same_variant() {
let mut y = (1i, 2i); let mut y = (1is, 2is);
let a = match y { let a = match y {
(ref mut a, _) => a (ref mut a, _) => a

View file

@ -12,9 +12,9 @@
#![feature(box_syntax)] #![feature(box_syntax)]
fn f() { fn f() {
let mut a = [box 0i, box 1i]; let mut a = [box 0is, box 1is];
drop(a[0]); drop(a[0]);
a[1] = box 2i; a[1] = box 2is;
drop(a[0]); //~ ERROR use of moved value: `a[..]` drop(a[0]); //~ ERROR use of moved value: `a[..]`
} }

View file

@ -11,14 +11,14 @@
fn foo() -> isize { fn foo() -> isize {
let x: isize; let x: isize;
while 1i != 2 { while 1is != 2 {
break; break;
x = 0; x = 0;
} }
println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x`
return 17i; return 17is;
} }
fn main() { println!("{}", foo()); } fn main() { println!("{}", foo()); }

View file

@ -22,37 +22,37 @@ fn set(x: &mut isize) {
} }
fn a() { fn a() {
let mut x = 3i; let mut x = 3is;
let c1 = |&mut:| x = 4; let c1 = |&mut:| x = 4;
let c2 = |&mut:| x * 5; //~ ERROR cannot borrow `x` let c2 = |&mut:| x * 5; //~ ERROR cannot borrow `x`
} }
fn b() { fn b() {
let mut x = 3i; let mut x = 3is;
let c1 = |&mut:| set(&mut x); let c1 = |&mut:| set(&mut x);
let c2 = |&mut:| get(&x); //~ ERROR cannot borrow `x` let c2 = |&mut:| get(&x); //~ ERROR cannot borrow `x`
} }
fn c() { fn c() {
let mut x = 3i; let mut x = 3is;
let c1 = |&mut:| set(&mut x); let c1 = |&mut:| set(&mut x);
let c2 = |&mut:| x * 5; //~ ERROR cannot borrow `x` let c2 = |&mut:| x * 5; //~ ERROR cannot borrow `x`
} }
fn d() { fn d() {
let mut x = 3i; let mut x = 3is;
let c2 = |&mut:| x * 5; let c2 = |&mut:| x * 5;
x = 5; //~ ERROR cannot assign x = 5; //~ ERROR cannot assign
} }
fn e() { fn e() {
let mut x = 3i; let mut x = 3is;
let c1 = |&mut:| get(&x); let c1 = |&mut:| get(&x);
x = 5; //~ ERROR cannot assign x = 5; //~ ERROR cannot assign
} }
fn f() { fn f() {
let mut x = box 3i; let mut x = box 3is;
let c1 = |&mut:| get(&*x); let c1 = |&mut:| get(&*x);
*x = 5; //~ ERROR cannot assign *x = 5; //~ ERROR cannot assign
} }

View file

@ -15,7 +15,7 @@
#![feature(box_syntax)] #![feature(box_syntax)]
fn a() { fn a() {
let mut x = 3i; let mut x = 3is;
let c1 = |&mut:| x = 4; let c1 = |&mut:| x = 4;
let c2 = |&mut:| x = 5; //~ ERROR cannot borrow `x` as mutable more than once let c2 = |&mut:| x = 5; //~ ERROR cannot borrow `x` as mutable more than once
} }
@ -25,19 +25,19 @@ fn set(x: &mut isize) {
} }
fn b() { fn b() {
let mut x = 3i; let mut x = 3is;
let c1 = |&mut:| set(&mut x); let c1 = |&mut:| set(&mut x);
let c2 = |&mut:| set(&mut x); //~ ERROR cannot borrow `x` as mutable more than once let c2 = |&mut:| set(&mut x); //~ ERROR cannot borrow `x` as mutable more than once
} }
fn c() { fn c() {
let mut x = 3i; let mut x = 3is;
let c1 = |&mut:| x = 5; let c1 = |&mut:| x = 5;
let c2 = |&mut:| set(&mut x); //~ ERROR cannot borrow `x` as mutable more than once let c2 = |&mut:| set(&mut x); //~ ERROR cannot borrow `x` as mutable more than once
} }
fn d() { fn d() {
let mut x = 3i; let mut x = 3is;
let c1 = |&mut:| x = 5; let c1 = |&mut:| x = 5;
let c2 = |&mut:| { let _y = |&mut:| set(&mut x); }; // (nested closure) let c2 = |&mut:| { let _y = |&mut:| set(&mut x); }; // (nested closure)
//~^ ERROR cannot borrow `x` as mutable more than once //~^ ERROR cannot borrow `x` as mutable more than once

View file

@ -17,7 +17,7 @@ struct Foo {
} }
fn main() { fn main() {
let mut y = 1i; let mut y = 1is;
let x = Some(&mut y); let x = Some(&mut y);
for &a in x.iter() { //~ ERROR cannot move out for &a in x.iter() { //~ ERROR cannot move out
} }
@ -28,7 +28,7 @@ fn main() {
for &a in f.a.iter() { //~ ERROR cannot move out for &a in f.a.iter() { //~ ERROR cannot move out
} }
let x = Some(box 1i); let x = Some(box 1is);
for &a in x.iter() { //~ ERROR cannot move out for &a in x.iter() { //~ ERROR cannot move out
} }
} }

View file

@ -11,11 +11,11 @@
use std::iter::repeat; use std::iter::repeat;
fn main() { fn main() {
let mut vector = vec![1u, 2]; let mut vector = vec![1us, 2];
for &x in vector.iter() { for &x in vector.iter() {
let cap = vector.capacity(); let cap = vector.capacity();
vector.extend(repeat(0)); //~ ERROR cannot borrow vector.extend(repeat(0)); //~ ERROR cannot borrow
vector[1u] = 5u; //~ ERROR cannot borrow vector[1us] = 5us; //~ ERROR cannot borrow
} }
} }

View file

@ -11,6 +11,6 @@
fn foo(x: isize) { println!("{}", x); } fn foo(x: isize) { println!("{}", x); }
fn main() { fn main() {
let x: isize; if 1i > 2 { x = 10; } let x: isize; if 1is > 2 { x = 10; }
foo(x); //~ ERROR use of possibly uninitialized variable: `x` foo(x); //~ ERROR use of possibly uninitialized variable: `x`
} }

View file

@ -12,7 +12,7 @@ fn foo(x: isize) { println!("{}", x); }
fn main() { fn main() {
let x: isize; let x: isize;
if 1i > 2 { if 1is > 2 {
println!("whoops"); println!("whoops");
} else { } else {
x = 10; x = 10;

View file

@ -9,7 +9,7 @@
// except according to those terms. // except according to those terms.
fn main() { fn main() {
let mut _a = 3i; let mut _a = 3is;
let _b = &mut _a; let _b = &mut _a;
{ {
let _c = &*_b; let _c = &*_b;

View file

@ -11,7 +11,7 @@
#![feature(box_syntax)] #![feature(box_syntax)]
fn main() { fn main() {
let x = Some(box 1i); let x = Some(box 1is);
match x { match x {
Some(ref _y) => { Some(ref _y) => {
let _a = x; //~ ERROR cannot move let _a = x; //~ ERROR cannot move

View file

@ -11,7 +11,7 @@
#![feature(box_syntax)] #![feature(box_syntax)]
fn main() { fn main() {
let x = Some(box 1i); let x = Some(box 1is);
match x { match x {
Some(ref y) => { Some(ref y) => {
let _b = *y; //~ ERROR cannot move out let _b = *y; //~ ERROR cannot move out

View file

@ -41,7 +41,7 @@ fn block_overarching_alias_mut() {
let mut v = box 3; let mut v = box 3;
let mut x = &mut v; let mut x = &mut v;
for _ in range(0i, 3) { for _ in range(0is, 3) {
borrow(&*v); //~ ERROR cannot borrow borrow(&*v); //~ ERROR cannot borrow
} }
*x = box 5; *x = box 5;

View file

@ -19,10 +19,10 @@ fn separate_arms() {
None => { None => {
// It is ok to reassign x here, because there is in // It is ok to reassign x here, because there is in
// fact no outstanding loan of x! // fact no outstanding loan of x!
x = Some(0i); x = Some(0is);
} }
Some(ref _i) => { Some(ref _i) => {
x = Some(1i); //~ ERROR cannot assign x = Some(1is); //~ ERROR cannot assign
} }
} }
x.clone(); // just to prevent liveness warnings x.clone(); // just to prevent liveness warnings

View file

@ -9,7 +9,7 @@
// except according to those terms. // except according to those terms.
fn f() { fn f() {
let x = [1i].iter(); //~ ERROR borrowed value does not live long enough let x = [1is].iter(); //~ ERROR borrowed value does not live long enough
//~^^ NOTE reference must be valid for the block //~^^ NOTE reference must be valid for the block
//~^^ HELP consider using a `let` binding to increase its lifetime //~^^ HELP consider using a `let` binding to increase its lifetime
} }

View file

@ -17,7 +17,7 @@ fn borrow<F>(v: &isize, f: F) where F: FnOnce(&isize) {
} }
fn box_imm() { fn box_imm() {
let v = box 3i; let v = box 3is;
let _w = &v; let _w = &v;
Thread::spawn(move|| { Thread::spawn(move|| {
println!("v={}", *v); println!("v={}", *v);
@ -26,7 +26,7 @@ fn box_imm() {
} }
fn box_imm_explicit() { fn box_imm_explicit() {
let v = box 3i; let v = box 3is;
let _w = &v; let _w = &v;
Thread::spawn(move|| { Thread::spawn(move|| {
println!("v={}", *v); println!("v={}", *v);

View file

@ -19,7 +19,7 @@ struct S {
} }
pub fn main() { pub fn main() {
match 1i { match 1is {
x => { x => {
x += 1; //~ ERROR re-assignment of immutable variable `x` x += 1; //~ ERROR re-assignment of immutable variable `x`
} }
@ -37,13 +37,13 @@ pub fn main() {
} }
} }
match (1i,) { match (1is,) {
(x,) => { (x,) => {
x += 1; //~ ERROR re-assignment of immutable variable `x` x += 1; //~ ERROR re-assignment of immutable variable `x`
} }
} }
match [1i,2,3] { match [1is,2,3] {
[x,_,_] => { [x,_,_] => {
x += 1; //~ ERROR re-assignment of immutable variable `x` x += 1; //~ ERROR re-assignment of immutable variable `x`
} }

View file

@ -14,7 +14,7 @@
#![feature(box_syntax)] #![feature(box_syntax)]
fn main() { fn main() {
let a = box box 2i; let a = box box 2is;
let b = &a; let b = &a;
let z = *a; //~ ERROR: cannot move out of `*a` because it is borrowed let z = *a; //~ ERROR: cannot move out of `*a` because it is borrowed

View file

@ -11,6 +11,6 @@
use std::rc::Rc; use std::rc::Rc;
pub fn main() { pub fn main() {
let _x = Rc::new(vec!(1i, 2)).into_iter(); let _x = Rc::new(vec!(1is, 2)).into_iter();
//~^ ERROR cannot move out of dereference of `&`-pointer //~^ ERROR cannot move out of dereference of `&`-pointer
} }

View file

@ -15,9 +15,9 @@ use std::thread::Thread;
fn borrow<T>(_: &T) { } fn borrow<T>(_: &T) { }
fn different_vars_after_borrows() { fn different_vars_after_borrows() {
let x1 = box 1i; let x1 = box 1is;
let p1 = &x1; let p1 = &x1;
let x2 = box 2i; let x2 = box 2is;
let p2 = &x2; let p2 = &x2;
Thread::spawn(move|| { Thread::spawn(move|| {
drop(x1); //~ ERROR cannot move `x1` into closure because it is borrowed drop(x1); //~ ERROR cannot move `x1` into closure because it is borrowed
@ -28,9 +28,9 @@ fn different_vars_after_borrows() {
} }
fn different_vars_after_moves() { fn different_vars_after_moves() {
let x1 = box 1i; let x1 = box 1is;
drop(x1); drop(x1);
let x2 = box 2i; let x2 = box 2is;
drop(x2); drop(x2);
Thread::spawn(move|| { Thread::spawn(move|| {
drop(x1); //~ ERROR capture of moved value: `x1` drop(x1); //~ ERROR capture of moved value: `x1`
@ -39,7 +39,7 @@ fn different_vars_after_moves() {
} }
fn same_var_after_borrow() { fn same_var_after_borrow() {
let x = box 1i; let x = box 1is;
let p = &x; let p = &x;
Thread::spawn(move|| { Thread::spawn(move|| {
drop(x); //~ ERROR cannot move `x` into closure because it is borrowed drop(x); //~ ERROR cannot move `x` into closure because it is borrowed
@ -49,7 +49,7 @@ fn same_var_after_borrow() {
} }
fn same_var_after_move() { fn same_var_after_move() {
let x = box 1i; let x = box 1is;
drop(x); drop(x);
Thread::spawn(move|| { Thread::spawn(move|| {
drop(x); //~ ERROR capture of moved value: `x` drop(x); //~ ERROR capture of moved value: `x`

View file

@ -25,7 +25,7 @@ impl<T> Index<usize> for MyVec<T> {
} }
fn main() { fn main() {
let v = MyVec { data: vec!(box 1i, box 2, box 3) }; let v = MyVec { data: vec!(box 1is, box 2, box 3) };
let good = &v[0]; // Shouldn't fail here let good = &v[0]; // Shouldn't fail here
let bad = v[0]; let bad = v[0];
//~^ ERROR cannot move out of dereference (dereference is implicit, due to indexing) //~^ ERROR cannot move out of dereference (dereference is implicit, due to indexing)

View file

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

View file

@ -13,7 +13,7 @@
fn borrow(_v: &isize) {} fn borrow(_v: &isize) {}
fn local() { fn local() {
let mut v = box 3i; let mut v = box 3is;
borrow(&*v); borrow(&*v);
} }
@ -32,27 +32,27 @@ fn local_recs() {
} }
fn aliased_imm() { fn aliased_imm() {
let mut v = box 3i; let mut v = box 3is;
let _w = &v; let _w = &v;
borrow(&*v); borrow(&*v);
} }
fn aliased_mut() { fn aliased_mut() {
let mut v = box 3i; let mut v = box 3is;
let _w = &mut v; let _w = &mut v;
borrow(&*v); //~ ERROR cannot borrow `*v` borrow(&*v); //~ ERROR cannot borrow `*v`
} }
fn aliased_other() { fn aliased_other() {
let mut v = box 3i; let mut v = box 3is;
let mut w = box 4i; let mut w = box 4is;
let _x = &mut w; let _x = &mut w;
borrow(&*v); borrow(&*v);
} }
fn aliased_other_reassign() { fn aliased_other_reassign() {
let mut v = box 3i; let mut v = box 3is;
let mut w = box 4i; let mut w = box 4is;
let mut _x = &mut w; let mut _x = &mut w;
_x = &mut v; _x = &mut v;
borrow(&*v); //~ ERROR cannot borrow `*v` borrow(&*v); //~ ERROR cannot borrow `*v`

View file

@ -9,7 +9,7 @@
// except according to those terms. // except according to those terms.
fn main() { fn main() {
let mut a = [1i, 2, 3, 4]; let mut a = [1is, 2, 3, 4];
let t = match a { let t = match a {
[1, 2, tail..] => tail, [1, 2, tail..] => tail,
_ => unreachable!() _ => unreachable!()

View file

@ -12,7 +12,7 @@
#![feature(box_syntax)] #![feature(box_syntax)]
fn a() { fn a() {
let mut vec = [box 1i, box 2, box 3]; let mut vec = [box 1is, box 2, box 3];
match vec { match vec {
[box ref _a, _, _] => { [box ref _a, _, _] => {
vec[0] = box 4; //~ ERROR cannot assign vec[0] = box 4; //~ ERROR cannot assign
@ -21,7 +21,7 @@ fn a() {
} }
fn b() { fn b() {
let mut vec = vec!(box 1i, box 2, box 3); let mut vec = vec!(box 1is, box 2, box 3);
let vec: &mut [Box<isize>] = vec.as_mut_slice(); let vec: &mut [Box<isize>] = vec.as_mut_slice();
match vec { match vec {
[_b..] => { [_b..] => {
@ -31,7 +31,7 @@ fn b() {
} }
fn c() { fn c() {
let mut vec = vec!(box 1i, box 2, box 3); let mut vec = vec!(box 1is, box 2, box 3);
let vec: &mut [Box<isize>] = vec.as_mut_slice(); let vec: &mut [Box<isize>] = vec.as_mut_slice();
match vec { match vec {
[_a, //~ ERROR cannot move out [_a, //~ ERROR cannot move out
@ -49,7 +49,7 @@ fn c() {
} }
fn d() { fn d() {
let mut vec = vec!(box 1i, box 2, box 3); let mut vec = vec!(box 1is, box 2, box 3);
let vec: &mut [Box<isize>] = vec.as_mut_slice(); let vec: &mut [Box<isize>] = vec.as_mut_slice();
match vec { match vec {
[_a.., //~ ERROR cannot move out [_a.., //~ ERROR cannot move out
@ -60,7 +60,7 @@ fn d() {
} }
fn e() { fn e() {
let mut vec = vec!(box 1i, box 2, box 3); let mut vec = vec!(box 1is, box 2, box 3);
let vec: &mut [Box<isize>] = vec.as_mut_slice(); let vec: &mut [Box<isize>] = vec.as_mut_slice();
match vec { match vec {
[_a, _b, _c] => {} //~ ERROR cannot move out [_a, _b, _c] => {} //~ ERROR cannot move out

View file

@ -11,7 +11,7 @@
fn test(cond: bool) { fn test(cond: bool) {
let v; let v;
while cond { while cond {
v = 3i; v = 3is;
break; break;
} }
println!("{}", v); //~ ERROR use of possibly uninitialized variable: `v` println!("{}", v); //~ ERROR use of possibly uninitialized variable: `v`

View file

@ -10,7 +10,7 @@
fn f() -> isize { fn f() -> isize {
let mut x: isize; let mut x: isize;
while 1i == 1 { x = 10; } while 1is == 1 { x = 10; }
return x; //~ ERROR use of possibly uninitialized variable: `x` return x; //~ ERROR use of possibly uninitialized variable: `x`
} }

View file

@ -22,6 +22,6 @@ impl <T: Sync> Foo for T { }
fn main() { fn main() {
let (tx, rx) = channel(); let (tx, rx) = channel();
1193182i.foo(tx); 1193182is.foo(tx);
assert!(rx.recv() == 1193182i); assert!(rx.recv() == 1193182is);
} }

View file

@ -9,7 +9,7 @@
// except according to those terms. // except according to those terms.
fn main() { fn main() {
let x = 1i; let x = 1is;
move|:| { x = 2; }; move|:| { x = 2; };
//~^ ERROR: cannot assign to immutable captured outer variable //~^ ERROR: cannot assign to immutable captured outer variable

View file

@ -15,5 +15,5 @@ class cat : nonexistent {
} }
fn main() { fn main() {
let nyan = cat(0u); let nyan = cat(0us);
} }

View file

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

View file

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

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
static A: usize = { 1u; 2 }; static A: usize = { 1us; 2 };
//~^ ERROR: blocks in constants are limited to items and tail expressions //~^ ERROR: blocks in constants are limited to items and tail expressions
static B: usize = { { } 2 }; static B: usize = { { } 2 };
@ -19,7 +19,7 @@ macro_rules! foo {
} }
static C: usize = { foo!(); 2 }; static C: usize = { foo!(); 2 };
static D: usize = { let x = 4u; 2 }; static D: usize = { let x = 4us; 2 };
//~^ ERROR: blocks in constants are limited to items and tail expressions //~^ ERROR: blocks in constants are limited to items and tail expressions
pub fn main() { pub fn main() {

View file

@ -22,10 +22,10 @@ impl S { }
impl T for S { } impl T for S { }
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
static s: usize = 0u; static s: usize = 0us;
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
const c: usize = 0u; const c: usize = 0us;
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
mod m { } mod m { }

View file

@ -27,17 +27,17 @@ fn main() {
// if n > m, it's a type mismatch error. // if n > m, it's a type mismatch error.
// n < m // n < m
let &x = &(&1i as &T); let &x = &(&1is as &T);
let &x = &&(&1i as &T); let &x = &&(&1is as &T);
let &&x = &&(&1i as &T); let &&x = &&(&1is as &T);
// n == m // n == m
let &x = &1i as &T; //~ ERROR type `&T` cannot be dereferenced let &x = &1is as &T; //~ ERROR type `&T` cannot be dereferenced
let &&x = &(&1i as &T); //~ ERROR type `&T` cannot be dereferenced let &&x = &(&1is as &T); //~ ERROR type `&T` cannot be dereferenced
let box x = box 1i as Box<T>; //~ ERROR type `Box<T>` cannot be dereferenced let box x = box 1is as Box<T>; //~ ERROR type `Box<T>` cannot be dereferenced
// n > m // n > m
let &&x = &1i as &T; //~ ERROR found &-ptr let &&x = &1is as &T; //~ ERROR found &-ptr
let &&&x = &(&1i as &T); //~ ERROR found &-ptr let &&&x = &(&1is as &T); //~ ERROR found &-ptr
let box box x = box 1i as Box<T>; //~ ERROR found box let box box x = box 1is as Box<T>; //~ ERROR found box
} }

View file

@ -18,7 +18,7 @@ struct Fat<T: ?Sized> {
} }
pub fn main() { pub fn main() {
let f: Fat<[isize; 3]> = Fat { ptr: [5i, 6, 7] }; let f: Fat<[isize; 3]> = Fat { ptr: [5is, 6, 7] };
let g: &Fat<[isize]> = &f; let g: &Fat<[isize]> = &f;
let h: &Fat<Fat<[isize]>> = &Fat { ptr: *g }; let h: &Fat<Fat<[isize]>> = &Fat { ptr: *g };
//~^ ERROR the trait `core::marker::Sized` is not implemented //~^ ERROR the trait `core::marker::Sized` is not implemented

View file

@ -9,7 +9,7 @@
// except according to those terms. // except according to those terms.
fn main() { fn main() {
let x = [ 1i, 2, 3, 4, 5 ]; let x = [ 1is, 2, 3, 4, 5 ];
match x { match x {
[ xs.., 4, 5 ] => {} //~ ERROR multiple-element slice matches [ xs.., 4, 5 ] => {} //~ ERROR multiple-element slice matches
[ 1, xs.., 5 ] => {} //~ ERROR multiple-element slice matches [ 1, xs.., 5 ] => {} //~ ERROR multiple-element slice matches

View file

@ -16,7 +16,7 @@ mod u {
x: usize //~ WARN the `usize` type is deprecated x: usize //~ WARN the `usize` type is deprecated
} }
fn bar(x: usize) { //~ WARN the `usize` type is deprecated fn bar(x: usize) { //~ WARN the `usize` type is deprecated
1u; //~ WARN the `u` suffix on integers is deprecated 1us; //~ WARN the `u` suffix on integers is deprecated
} }
} }
mod i { mod i {
@ -25,7 +25,7 @@ mod i {
x: isize //~ WARN the `isize` type is deprecated x: isize //~ WARN the `isize` type is deprecated
} }
fn bar(x: isize) { //~ WARN the `isize` type is deprecated fn bar(x: isize) { //~ WARN the `isize` type is deprecated
1i; //~ WARN the `u` suffix on integers is deprecated 1is; //~ WARN the `u` suffix on integers is deprecated
} }
} }

View file

@ -21,5 +21,5 @@ fn main() {
let _: () = (box |&mut:| -> isize unimplemented!()) as Box<FnMut() -> isize>; let _: () = (box |&mut:| -> isize unimplemented!()) as Box<FnMut() -> isize>;
//~^ ERROR Box<core::ops::FnMut() -> isize> //~^ ERROR Box<core::ops::FnMut() -> isize>
needs_fn(1i); //~ ERROR `core::ops::Fn(isize) -> isize` needs_fn(1is); //~ ERROR `core::ops::Fn(isize) -> isize`
} }

View file

@ -11,6 +11,6 @@
fn main() { fn main() {
for for
&1i //~ ERROR refutable pattern in `for` loop binding &1is //~ ERROR refutable pattern in `for` loop binding
in [1i].iter() {} in [1is].iter() {}
} }

View file

@ -10,7 +10,7 @@
fn main() { fn main() {
let mut my_stuff = std::collections::HashMap::new(); let mut my_stuff = std::collections::HashMap::new();
my_stuff.insert(0i, 42i); my_stuff.insert(0is, 42is);
let (_, thing) = my_stuff.iter().next().unwrap(); let (_, thing) = my_stuff.iter().next().unwrap();

View file

@ -10,7 +10,7 @@
fn main() { fn main() {
let mut my_stuff = std::collections::HashMap::new(); let mut my_stuff = std::collections::HashMap::new();
my_stuff.insert(0i, 42i); my_stuff.insert(0is, 42is);
let mut it = my_stuff.iter(); let mut it = my_stuff.iter();
my_stuff.insert(1, 43); //~ ERROR cannot borrow my_stuff.insert(1, 43); //~ ERROR cannot borrow

View file

@ -20,20 +20,20 @@ fn macros() {
}} }}
} }
foo!(a, 1i, { //~ ERROR irrefutable if-let foo!(a, 1is, { //~ ERROR irrefutable if-let
println!("irrefutable pattern"); println!("irrefutable pattern");
}); });
bar!(a, 1i, { //~ ERROR irrefutable if-let bar!(a, 1is, { //~ ERROR irrefutable if-let
println!("irrefutable pattern"); println!("irrefutable pattern");
}); });
} }
pub fn main() { pub fn main() {
if let a = 1i { //~ ERROR irrefutable if-let if let a = 1is { //~ ERROR irrefutable if-let
println!("irrefutable pattern"); println!("irrefutable pattern");
} }
if let a = 1i { //~ ERROR irrefutable if-let if let a = 1is { //~ ERROR irrefutable if-let
println!("irrefutable pattern"); println!("irrefutable pattern");
} else if true { } else if true {
println!("else-if in irrefutable if-let"); println!("else-if in irrefutable if-let");
@ -41,15 +41,15 @@ pub fn main() {
println!("else in irrefutable if-let"); println!("else in irrefutable if-let");
} }
if let 1i = 2i { if let 1is = 2is {
println!("refutable pattern"); println!("refutable pattern");
} else if let a = 1i { //~ ERROR irrefutable if-let } else if let a = 1is { //~ ERROR irrefutable if-let
println!("irrefutable pattern"); println!("irrefutable pattern");
} }
if true { if true {
println!("if"); println!("if");
} else if let a = 1i { //~ ERROR irrefutable if-let } else if let a = 1is { //~ ERROR irrefutable if-let
println!("irrefutable pattern"); println!("irrefutable pattern");
} }
} }

View file

@ -11,5 +11,5 @@
use std::num::SignedInt; use std::num::SignedInt;
fn main() { fn main() {
let _f = 10i.abs; //~ ERROR attempted to take value of method let _f = 10is.abs; //~ ERROR attempted to take value of method
} }

View file

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

View file

@ -9,5 +9,5 @@
// except according to those terms. // except according to those terms.
fn main() { fn main() {
(return)[0u]; //~ ERROR the type of this value must be known in this context (return)[0us]; //~ ERROR the type of this value must be known in this context
} }

View file

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

View file

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

View file

@ -11,7 +11,7 @@
#![feature(box_syntax)] #![feature(box_syntax)]
fn main() { fn main() {
let x = box 1i; let x = box 1is;
let f = move|:| { let f = move|:| {
let _a = x; let _a = x;
drop(x); drop(x);

View file

@ -11,6 +11,6 @@
// This file must never have a trailing newline // This file must never have a trailing newline
fn main() { fn main() {
let x = Some(3i); let x = Some(3is);
let y = x.as_ref().unwrap_or(&5i); //~ ERROR: borrowed value does not live long enough let y = x.as_ref().unwrap_or(&5is); //~ ERROR: borrowed value does not live long enough
} }

View file

@ -9,7 +9,7 @@
// except according to those terms. // except according to those terms.
fn blah() -> isize { //~ ERROR not all control paths return a value fn blah() -> isize { //~ ERROR not all control paths return a value
1i 1is
; //~ HELP consider removing this semicolon: ; //~ HELP consider removing this semicolon:
} }

View file

@ -9,8 +9,8 @@
// except according to those terms. // except according to those terms.
fn main() { fn main() {
let mut v = vec!(1i); let mut v = vec!(1is);
let mut f = |&mut:| v.push(2i); let mut f = |&mut:| v.push(2is);
let _w = v; //~ ERROR: cannot move out of `v` let _w = v; //~ ERROR: cannot move out of `v`
f(); f();

View file

@ -12,7 +12,7 @@
fn main() { fn main() {
let r = { let r = {
let x = box 42i; let x = box 42is;
let f = move|:| &x; //~ ERROR: `x` does not live long enough let f = move|:| &x; //~ ERROR: `x` does not live long enough
f() f()
}; };

View file

@ -17,7 +17,7 @@ fn main() {
loop { loop {
let tx = tx; let tx = tx;
//~^ ERROR: use of moved value: `tx` //~^ ERROR: use of moved value: `tx`
tx.send(1i); tx.send(1is);
} }
}); });
} }

View file

@ -34,6 +34,6 @@ fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
} }
fn main() { fn main() {
check((3u, 5u)); check((3us, 5us));
//~^ ERROR mismatched types: expected `&_`, found `(usize, usize)` (expected &-ptr, found tuple) //~^ ERROR mismatched types: expected `&_`, found `(usize, usize)` (expected &-ptr, found tuple)
} }

View file

@ -14,7 +14,7 @@ fn main() {
let x = [1,2]; let x = [1,2];
let y = match x { let y = match x {
[] => None, [] => None,
//~^ ERROR types: expected `[_#0i; 2]`, found `[_#7t; 0]` //~^ ERROR types: expected `[_#0is; 2]`, found `[_#7t; 0]`
// (expected array of 2 elements, found array of 0 elements) // (expected array of 2 elements, found array of 0 elements)
[a,_] => Some(a) [a,_] => Some(a)
}; };

View file

@ -11,7 +11,7 @@
// Regression test for issue #1362 - without that fix the span will be bogus // Regression test for issue #1362 - without that fix the span will be bogus
// no-reformat // no-reformat
fn main() { fn main() {
let x: usize = 20i; //~ ERROR mismatched types let x: usize = 20is; //~ ERROR mismatched types
} }
// NOTE: Do not add any extra lines as the line number the error is // 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 // on is significant; an error later in the source file might not

View file

@ -13,5 +13,5 @@
fn foo(a: usize) -> usize { a } fn foo(a: usize) -> usize { a }
fn main() { fn main() {
println!("{}", foo(10i)); //~ ERROR mismatched types println!("{}", foo(10is)); //~ ERROR mismatched types
} }

View file

@ -28,6 +28,6 @@ fn make_shower<T>(x: T) -> Shower<T> {
} }
pub fn main() { pub fn main() {
let show3 = make_shower(3i); let show3 = make_shower(3is);
show3(); show3();
} }

View file

@ -18,7 +18,7 @@
macro_rules! f { () => (n) } macro_rules! f { () => (n) }
fn main() -> (){ fn main() -> (){
for n in range(0i, 1) { for n in range(0is, 1) {
println!("{}", f!()); //~ ERROR unresolved name `n` println!("{}", f!()); //~ ERROR unresolved name `n`
} }
} }

View file

@ -10,7 +10,7 @@
fn main() { fn main() {
let v = vec![ let v = vec![
&3i &3is
//~^ ERROR borrowed value does not live long enough //~^ ERROR borrowed value does not live long enough
]; ];

View file

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

View file

@ -23,10 +23,10 @@ impl Drop for Enum {
} }
fn main() { fn main() {
let foo = X(1i); let foo = X(1is);
drop(foo); drop(foo);
match foo { //~ ERROR use of moved value match foo { //~ ERROR use of moved value
X(1i) => (), X(1is) => (),
_ => unreachable!() _ => unreachable!()
} }

View file

@ -13,7 +13,7 @@ enum Foo {
} }
fn main() { fn main() {
match Foo::Bar(1i) { match Foo::Bar(1is) {
Foo { i } => () //~ ERROR `Foo` does not name a struct or a struct variant Foo { i } => () //~ ERROR `Foo` does not name a struct or a struct variant
} }
} }

View file

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

View file

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

View file

@ -14,8 +14,8 @@ enum MyOption<T> {
} }
fn main() { fn main() {
match MyOption::MySome(42i) { match MyOption::MySome(42is) {
MyOption::MySome { x: 42i } => (), MyOption::MySome { x: 42is } => (),
//~^ ERROR `MyOption::MySome` does not name a struct or a struct variant //~^ ERROR `MyOption::MySome` does not name a struct or a struct variant
_ => (), _ => (),
} }

View file

@ -15,14 +15,14 @@
#[cfg(any(all(stage0, target_word_size = "64"), all(not(stage0), target_pointer_width = "64")))] #[cfg(any(all(stage0, target_word_size = "64"), all(not(stage0), target_pointer_width = "64")))]
fn main() { fn main() {
let n = 0u; let n = 0us;
let a = box [&n; 0xF000000000000000u]; let a = box [&n; 0xF000000000000000us];
println!("{}", a[0xFFFFFFu]); println!("{}", a[0xFFFFFFu]);
} }
#[cfg(any(all(stage0, target_word_size = "32"), all(not(stage0), target_pointer_width = "32")))] #[cfg(any(all(stage0, target_word_size = "32"), all(not(stage0), target_pointer_width = "32")))]
fn main() { fn main() {
let n = 0u; let n = 0us;
let a = box [&n; 0xFFFFFFFFu]; let a = box [&n; 0xFFFFFFFFu];
println!("{}", a[0xFFFFFFu]); println!("{}", a[0xFFFFFFu]);
} }

View file

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

View file

@ -11,7 +11,7 @@
#![deny(unused_variables)] #![deny(unused_variables)]
fn main() { fn main() {
for _ in range(1i, 101) { for _ in range(1is, 101) {
let x = (); //~ ERROR: unused variable: `x` let x = (); //~ ERROR: unused variable: `x`
match () { match () {
a => {} //~ ERROR: unused variable: `a` a => {} //~ ERROR: unused variable: `a`

View file

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

View file

@ -13,5 +13,5 @@ enum Foo {
} }
fn main() { fn main() {
let f = Foo::Variant(42u); //~ ERROR uses it like a function let f = Foo::Variant(42us); //~ ERROR uses it like a function
} }

View file

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

View file

@ -14,7 +14,7 @@ use std::cell::RefCell;
fn main() { fn main() {
let c = RefCell::new(vec![]); let c = RefCell::new(vec![]);
let mut y = 1u; let mut y = 1us;
c.push(box || y = 0); c.push(box || y = 0);
c.push(box || y = 0); c.push(box || y = 0);
//~^ ERROR cannot borrow `y` as mutable more than once at a time //~^ ERROR cannot borrow `y` as mutable more than once at a time
@ -22,7 +22,7 @@ fn main() {
fn ufcs() { fn ufcs() {
let c = RefCell::new(vec![]); let c = RefCell::new(vec![]);
let mut y = 1u; let mut y = 1us;
Push::push(&c, box || y = 0); Push::push(&c, box || y = 0);
Push::push(&c, box || y = 0); Push::push(&c, box || y = 0);

View file

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

View file

@ -9,6 +9,6 @@
// except according to those terms. // except according to those terms.
fn main() { fn main() {
let t = (42i, 42i); let t = (42is, 42is);
t.0::<isize>; //~ ERROR expected one of `.`, `;`, `}`, or an operator, found `::` t.0::<isize>; //~ ERROR expected one of `.`, `;`, `}`, or an operator, found `::`
} }

View file

@ -10,9 +10,9 @@
// compile-flags: -D while-true // compile-flags: -D while-true
fn main() { fn main() {
let mut i = 0i; let mut i = 0is;
while true { //~ ERROR denote infinite loops with loop while true { //~ ERROR denote infinite loops with loop
i += 1i; i += 1is;
if i == 5i { break; } if i == 5is { break; }
} }
} }

View file

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

View file

@ -14,7 +14,7 @@ struct Obj {
impl Obj { impl Obj {
pub fn boom() -> bool { pub fn boom() -> bool {
return 1i+1 == 2 return 1is+1 == 2
} }
pub fn chirp(&self) { pub fn chirp(&self) {
self.boom(); //~ ERROR `&Obj` does not implement any method in scope named `boom` self.boom(); //~ ERROR `&Obj` does not implement any method in scope named `boom`
@ -24,5 +24,5 @@ impl Obj {
fn main() { fn main() {
let o = Obj { member: 0 }; let o = Obj { member: 0 };
o.chirp(); o.chirp();
1i + 1; 1is + 1;
} }

View file

@ -18,6 +18,6 @@ fn f<'r, T>(v: &'r T) -> Box<FnMut() -> T + 'r> {
} }
fn main() { fn main() {
let v = &5i; let v = &5is;
println!("{}", f(v).call_mut(())); println!("{}", f(v).call_mut(()));
} }

View file

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

View file

@ -19,7 +19,7 @@ impl<T:Copy> Foo for T {
fn take_param<T:Foo>(foo: &T) { } fn take_param<T:Foo>(foo: &T) { }
fn main() { fn main() {
let x = box 3i; let x = box 3is;
take_param(&x); take_param(&x);
//~^ ERROR the trait `core::marker::Copy` is not implemented //~^ ERROR the trait `core::marker::Copy` is not implemented
} }

View file

@ -23,12 +23,12 @@ impl<T:Copy> Foo for T {
fn take_param<T:Foo>(foo: &T) { } fn take_param<T:Foo>(foo: &T) { }
fn a() { fn a() {
let x = box 3i; let x = box 3is;
take_param(&x); //~ ERROR `core::marker::Copy` is not implemented take_param(&x); //~ ERROR `core::marker::Copy` is not implemented
} }
fn b() { fn b() {
let x = box 3i; let x = box 3is;
let y = &x; let y = &x;
let z = &x as &Foo; //~ ERROR `core::marker::Copy` is not implemented let z = &x as &Foo; //~ ERROR `core::marker::Copy` is not implemented
} }

View file

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

View file

@ -90,7 +90,7 @@ pub fn pub_fn() {
let e = used_enum::foo3; let e = used_enum::foo3;
SemiUsedStruct::la_la_la(); SemiUsedStruct::la_la_la();
let i = 1i; let i = 1is;
match i { match i {
USED_STATIC => (), USED_STATIC => (),
USED_CONST => (), USED_CONST => (),

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