Update compile-fail tests to use is/us, not i/u.
This commit is contained in:
parent
85f961e2cc
commit
441044f071
194 changed files with 379 additions and 379 deletions
|
@ -11,5 +11,5 @@
|
|||
// Test that the old fixed length array syntax is a parsing error.
|
||||
|
||||
fn main() {
|
||||
let _x: [isize, ..3] = [0i, 1, 2]; //~ ERROR
|
||||
let _x: [isize, ..3] = [0is, 1, 2]; //~ ERROR
|
||||
}
|
||||
|
|
|
@ -11,5 +11,5 @@
|
|||
// Test that the old repeating array syntax gives an error.
|
||||
|
||||
fn main() {
|
||||
let _ = [0i, ..3]; //~ ERROR
|
||||
let _ = [0is, ..3]; //~ ERROR
|
||||
}
|
||||
|
|
|
@ -20,8 +20,8 @@ pub fn main() {
|
|||
let x: isize;
|
||||
let y: isize;
|
||||
unsafe {
|
||||
asm!("mov $1, $0" : "=r"(x) : "=r"(5u)); //~ ERROR input operand constraint contains '='
|
||||
asm!("mov $1, $0" : "=r"(y) : "+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"(5us)); //~ ERROR input operand constraint contains '+'
|
||||
}
|
||||
foo(x);
|
||||
foo(y);
|
||||
|
|
|
@ -21,14 +21,14 @@ pub fn main() {
|
|||
let mut x: isize = 0;
|
||||
unsafe {
|
||||
// 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
|
||||
}
|
||||
assert_eq!(x, 5);
|
||||
|
||||
unsafe {
|
||||
// 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
|
||||
}
|
||||
assert_eq!(x, 13);
|
||||
|
|
|
@ -21,7 +21,7 @@ pub fn main() {
|
|||
x = 1; //~ NOTE prior assignment occurs here
|
||||
foo(x);
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ fn foo(x: isize) { println!("{}", x); }
|
|||
pub fn main() {
|
||||
let x: isize;
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ struct 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 {
|
||||
|
@ -26,6 +26,6 @@ fn cat(in_x : usize, in_y : isize) -> cat {
|
|||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ pub fn baz(x: &Foo<A=Bar>) {
|
|||
|
||||
|
||||
pub fn main() {
|
||||
let a = 42i;
|
||||
let a = 42is;
|
||||
foo1(a); //~ERROR expected usize, found struct Bar
|
||||
baz(&a); //~ERROR expected usize, found struct Bar
|
||||
}
|
||||
|
|
|
@ -28,15 +28,15 @@ impl Foo for isize {
|
|||
}
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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 `B` (from the trait `Foo`) must be specified
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
// Tests that a function with a ! annotation always actually fails
|
||||
|
||||
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); }
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
// Tests that a function with a ! annotation always actually fails
|
||||
|
||||
fn bad_bang(i: usize) -> ! { //~ ERROR computation may converge in a function marked as diverging
|
||||
if i < 0u { } else { panic!(); }
|
||||
if i < 0us { } else { panic!(); }
|
||||
}
|
||||
|
||||
fn main() { bad_bang(5u); }
|
||||
fn main() { bad_bang(5us); }
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
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 {
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn f() -> ! { //~ ERROR computation may converge in a function marked as diverging
|
||||
3i
|
||||
3is
|
||||
}
|
||||
fn main() { }
|
||||
|
|
|
@ -18,24 +18,24 @@ fn set(x: &mut usize) { *x = 5; }
|
|||
fn main() {
|
||||
// By-ref captures
|
||||
{
|
||||
let mut x = 0u;
|
||||
let mut x = 0us;
|
||||
let _f = |&:| x = 42; //~ ERROR cannot assign
|
||||
|
||||
let mut y = 0u;
|
||||
let mut y = 0us;
|
||||
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
|
||||
}
|
||||
// By-value captures
|
||||
{
|
||||
let mut x = 0u;
|
||||
let mut x = 0us;
|
||||
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 mut z = 0u;
|
||||
let mut z = 0us;
|
||||
let _h = move |&mut:| { set(&mut z); move |&:| z = 42; }; //~ ERROR cannot assign
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,28 +16,28 @@ struct Foo(Box<isize>, isize);
|
|||
struct Bar(isize, isize);
|
||||
|
||||
fn main() {
|
||||
let x = (box 1i, 2i);
|
||||
let x = (box 1is, 2is);
|
||||
let r = &x.0;
|
||||
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 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 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 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 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 b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable more than once at a time
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// anonymous fields of a tuple vs the same anonymous field.
|
||||
|
||||
fn distinct_variant() {
|
||||
let mut y = (1i, 2i);
|
||||
let mut y = (1is, 2is);
|
||||
|
||||
let a = match y {
|
||||
(ref mut a, _) => a
|
||||
|
@ -27,7 +27,7 @@ fn distinct_variant() {
|
|||
}
|
||||
|
||||
fn same_variant() {
|
||||
let mut y = (1i, 2i);
|
||||
let mut y = (1is, 2is);
|
||||
|
||||
let a = match y {
|
||||
(ref mut a, _) => a
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
#![feature(box_syntax)]
|
||||
|
||||
fn f() {
|
||||
let mut a = [box 0i, box 1i];
|
||||
let mut a = [box 0is, box 1is];
|
||||
drop(a[0]);
|
||||
a[1] = box 2i;
|
||||
a[1] = box 2is;
|
||||
drop(a[0]); //~ ERROR use of moved value: `a[..]`
|
||||
}
|
||||
|
||||
|
|
|
@ -11,14 +11,14 @@
|
|||
fn foo() -> isize {
|
||||
let x: isize;
|
||||
|
||||
while 1i != 2 {
|
||||
while 1is != 2 {
|
||||
break;
|
||||
x = 0;
|
||||
}
|
||||
|
||||
println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x`
|
||||
|
||||
return 17i;
|
||||
return 17is;
|
||||
}
|
||||
|
||||
fn main() { println!("{}", foo()); }
|
||||
|
|
|
@ -22,37 +22,37 @@ fn set(x: &mut isize) {
|
|||
}
|
||||
|
||||
fn a() {
|
||||
let mut x = 3i;
|
||||
let mut x = 3is;
|
||||
let c1 = |&mut:| x = 4;
|
||||
let c2 = |&mut:| x * 5; //~ ERROR cannot borrow `x`
|
||||
}
|
||||
|
||||
fn b() {
|
||||
let mut x = 3i;
|
||||
let mut x = 3is;
|
||||
let c1 = |&mut:| set(&mut x);
|
||||
let c2 = |&mut:| get(&x); //~ ERROR cannot borrow `x`
|
||||
}
|
||||
|
||||
fn c() {
|
||||
let mut x = 3i;
|
||||
let mut x = 3is;
|
||||
let c1 = |&mut:| set(&mut x);
|
||||
let c2 = |&mut:| x * 5; //~ ERROR cannot borrow `x`
|
||||
}
|
||||
|
||||
fn d() {
|
||||
let mut x = 3i;
|
||||
let mut x = 3is;
|
||||
let c2 = |&mut:| x * 5;
|
||||
x = 5; //~ ERROR cannot assign
|
||||
}
|
||||
|
||||
fn e() {
|
||||
let mut x = 3i;
|
||||
let mut x = 3is;
|
||||
let c1 = |&mut:| get(&x);
|
||||
x = 5; //~ ERROR cannot assign
|
||||
}
|
||||
|
||||
fn f() {
|
||||
let mut x = box 3i;
|
||||
let mut x = box 3is;
|
||||
let c1 = |&mut:| get(&*x);
|
||||
*x = 5; //~ ERROR cannot assign
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#![feature(box_syntax)]
|
||||
|
||||
fn a() {
|
||||
let mut x = 3i;
|
||||
let mut x = 3is;
|
||||
let c1 = |&mut:| x = 4;
|
||||
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() {
|
||||
let mut x = 3i;
|
||||
let mut x = 3is;
|
||||
let c1 = |&mut:| set(&mut x);
|
||||
let c2 = |&mut:| set(&mut x); //~ ERROR cannot borrow `x` as mutable more than once
|
||||
}
|
||||
|
||||
fn c() {
|
||||
let mut x = 3i;
|
||||
let mut x = 3is;
|
||||
let c1 = |&mut:| x = 5;
|
||||
let c2 = |&mut:| set(&mut x); //~ ERROR cannot borrow `x` as mutable more than once
|
||||
}
|
||||
|
||||
fn d() {
|
||||
let mut x = 3i;
|
||||
let mut x = 3is;
|
||||
let c1 = |&mut:| x = 5;
|
||||
let c2 = |&mut:| { let _y = |&mut:| set(&mut x); }; // (nested closure)
|
||||
//~^ ERROR cannot borrow `x` as mutable more than once
|
||||
|
|
|
@ -17,7 +17,7 @@ struct Foo {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let mut y = 1i;
|
||||
let mut y = 1is;
|
||||
let x = Some(&mut y);
|
||||
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
|
||||
}
|
||||
|
||||
let x = Some(box 1i);
|
||||
let x = Some(box 1is);
|
||||
for &a in x.iter() { //~ ERROR cannot move out
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
use std::iter::repeat;
|
||||
|
||||
fn main() {
|
||||
let mut vector = vec![1u, 2];
|
||||
let mut vector = vec![1us, 2];
|
||||
for &x in vector.iter() {
|
||||
let cap = vector.capacity();
|
||||
vector.extend(repeat(0)); //~ ERROR cannot borrow
|
||||
vector[1u] = 5u; //~ ERROR cannot borrow
|
||||
vector[1us] = 5us; //~ ERROR cannot borrow
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
fn foo(x: isize) { println!("{}", x); }
|
||||
|
||||
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`
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ fn foo(x: isize) { println!("{}", x); }
|
|||
|
||||
fn main() {
|
||||
let x: isize;
|
||||
if 1i > 2 {
|
||||
if 1is > 2 {
|
||||
println!("whoops");
|
||||
} else {
|
||||
x = 10;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
let mut _a = 3i;
|
||||
let mut _a = 3is;
|
||||
let _b = &mut _a;
|
||||
{
|
||||
let _c = &*_b;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#![feature(box_syntax)]
|
||||
|
||||
fn main() {
|
||||
let x = Some(box 1i);
|
||||
let x = Some(box 1is);
|
||||
match x {
|
||||
Some(ref _y) => {
|
||||
let _a = x; //~ ERROR cannot move
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#![feature(box_syntax)]
|
||||
|
||||
fn main() {
|
||||
let x = Some(box 1i);
|
||||
let x = Some(box 1is);
|
||||
match x {
|
||||
Some(ref y) => {
|
||||
let _b = *y; //~ ERROR cannot move out
|
||||
|
|
|
@ -41,7 +41,7 @@ fn block_overarching_alias_mut() {
|
|||
|
||||
let mut v = box 3;
|
||||
let mut x = &mut v;
|
||||
for _ in range(0i, 3) {
|
||||
for _ in range(0is, 3) {
|
||||
borrow(&*v); //~ ERROR cannot borrow
|
||||
}
|
||||
*x = box 5;
|
||||
|
|
|
@ -19,10 +19,10 @@ fn separate_arms() {
|
|||
None => {
|
||||
// It is ok to reassign x here, because there is in
|
||||
// fact no outstanding loan of x!
|
||||
x = Some(0i);
|
||||
x = Some(0is);
|
||||
}
|
||||
Some(ref _i) => {
|
||||
x = Some(1i); //~ ERROR cannot assign
|
||||
x = Some(1is); //~ ERROR cannot assign
|
||||
}
|
||||
}
|
||||
x.clone(); // just to prevent liveness warnings
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
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
|
||||
//~^^ HELP consider using a `let` binding to increase its lifetime
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ fn borrow<F>(v: &isize, f: F) where F: FnOnce(&isize) {
|
|||
}
|
||||
|
||||
fn box_imm() {
|
||||
let v = box 3i;
|
||||
let v = box 3is;
|
||||
let _w = &v;
|
||||
Thread::spawn(move|| {
|
||||
println!("v={}", *v);
|
||||
|
@ -26,7 +26,7 @@ fn box_imm() {
|
|||
}
|
||||
|
||||
fn box_imm_explicit() {
|
||||
let v = box 3i;
|
||||
let v = box 3is;
|
||||
let _w = &v;
|
||||
Thread::spawn(move|| {
|
||||
println!("v={}", *v);
|
||||
|
|
|
@ -19,7 +19,7 @@ struct S {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
match 1i {
|
||||
match 1is {
|
||||
x => {
|
||||
x += 1; //~ ERROR re-assignment of immutable variable `x`
|
||||
}
|
||||
|
@ -37,13 +37,13 @@ pub fn main() {
|
|||
}
|
||||
}
|
||||
|
||||
match (1i,) {
|
||||
match (1is,) {
|
||||
(x,) => {
|
||||
x += 1; //~ ERROR re-assignment of immutable variable `x`
|
||||
}
|
||||
}
|
||||
|
||||
match [1i,2,3] {
|
||||
match [1is,2,3] {
|
||||
[x,_,_] => {
|
||||
x += 1; //~ ERROR re-assignment of immutable variable `x`
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#![feature(box_syntax)]
|
||||
|
||||
fn main() {
|
||||
let a = box box 2i;
|
||||
let a = box box 2is;
|
||||
let b = &a;
|
||||
|
||||
let z = *a; //~ ERROR: cannot move out of `*a` because it is borrowed
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
use std::rc::Rc;
|
||||
|
||||
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
|
||||
}
|
||||
|
|
|
@ -15,9 +15,9 @@ use std::thread::Thread;
|
|||
fn borrow<T>(_: &T) { }
|
||||
|
||||
fn different_vars_after_borrows() {
|
||||
let x1 = box 1i;
|
||||
let x1 = box 1is;
|
||||
let p1 = &x1;
|
||||
let x2 = box 2i;
|
||||
let x2 = box 2is;
|
||||
let p2 = &x2;
|
||||
Thread::spawn(move|| {
|
||||
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() {
|
||||
let x1 = box 1i;
|
||||
let x1 = box 1is;
|
||||
drop(x1);
|
||||
let x2 = box 2i;
|
||||
let x2 = box 2is;
|
||||
drop(x2);
|
||||
Thread::spawn(move|| {
|
||||
drop(x1); //~ ERROR capture of moved value: `x1`
|
||||
|
@ -39,7 +39,7 @@ fn different_vars_after_moves() {
|
|||
}
|
||||
|
||||
fn same_var_after_borrow() {
|
||||
let x = box 1i;
|
||||
let x = box 1is;
|
||||
let p = &x;
|
||||
Thread::spawn(move|| {
|
||||
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() {
|
||||
let x = box 1i;
|
||||
let x = box 1is;
|
||||
drop(x);
|
||||
Thread::spawn(move|| {
|
||||
drop(x); //~ ERROR capture of moved value: `x`
|
||||
|
|
|
@ -25,7 +25,7 @@ impl<T> Index<usize> for MyVec<T> {
|
|||
}
|
||||
|
||||
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 bad = v[0];
|
||||
//~^ ERROR cannot move out of dereference (dereference is implicit, due to indexing)
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#![allow(dead_code)]
|
||||
fn main() {
|
||||
// Original borrow ends at end of function
|
||||
let mut x = 1u;
|
||||
let mut x = 1us;
|
||||
let y = &mut x;
|
||||
let z = &x; //~ ERROR cannot borrow
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ fn foo() {
|
|||
match true {
|
||||
true => {
|
||||
// Original borrow ends at end of match arm
|
||||
let mut x = 1u;
|
||||
let mut x = 1us;
|
||||
let y = &x;
|
||||
let z = &mut x; //~ ERROR cannot borrow
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ fn foo() {
|
|||
fn bar() {
|
||||
// Original borrow ends at end of closure
|
||||
|&:| {
|
||||
let mut x = 1u;
|
||||
let mut x = 1us;
|
||||
let y = &mut x;
|
||||
let z = &mut x; //~ ERROR cannot borrow
|
||||
};
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
fn borrow(_v: &isize) {}
|
||||
|
||||
fn local() {
|
||||
let mut v = box 3i;
|
||||
let mut v = box 3is;
|
||||
borrow(&*v);
|
||||
}
|
||||
|
||||
|
@ -32,27 +32,27 @@ fn local_recs() {
|
|||
}
|
||||
|
||||
fn aliased_imm() {
|
||||
let mut v = box 3i;
|
||||
let mut v = box 3is;
|
||||
let _w = &v;
|
||||
borrow(&*v);
|
||||
}
|
||||
|
||||
fn aliased_mut() {
|
||||
let mut v = box 3i;
|
||||
let mut v = box 3is;
|
||||
let _w = &mut v;
|
||||
borrow(&*v); //~ ERROR cannot borrow `*v`
|
||||
}
|
||||
|
||||
fn aliased_other() {
|
||||
let mut v = box 3i;
|
||||
let mut w = box 4i;
|
||||
let mut v = box 3is;
|
||||
let mut w = box 4is;
|
||||
let _x = &mut w;
|
||||
borrow(&*v);
|
||||
}
|
||||
|
||||
fn aliased_other_reassign() {
|
||||
let mut v = box 3i;
|
||||
let mut w = box 4i;
|
||||
let mut v = box 3is;
|
||||
let mut w = box 4is;
|
||||
let mut _x = &mut w;
|
||||
_x = &mut v;
|
||||
borrow(&*v); //~ ERROR cannot borrow `*v`
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
let mut a = [1i, 2, 3, 4];
|
||||
let mut a = [1is, 2, 3, 4];
|
||||
let t = match a {
|
||||
[1, 2, tail..] => tail,
|
||||
_ => unreachable!()
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#![feature(box_syntax)]
|
||||
|
||||
fn a() {
|
||||
let mut vec = [box 1i, box 2, box 3];
|
||||
let mut vec = [box 1is, box 2, box 3];
|
||||
match vec {
|
||||
[box ref _a, _, _] => {
|
||||
vec[0] = box 4; //~ ERROR cannot assign
|
||||
|
@ -21,7 +21,7 @@ fn a() {
|
|||
}
|
||||
|
||||
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();
|
||||
match vec {
|
||||
[_b..] => {
|
||||
|
@ -31,7 +31,7 @@ fn b() {
|
|||
}
|
||||
|
||||
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();
|
||||
match vec {
|
||||
[_a, //~ ERROR cannot move out
|
||||
|
@ -49,7 +49,7 @@ fn c() {
|
|||
}
|
||||
|
||||
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();
|
||||
match vec {
|
||||
[_a.., //~ ERROR cannot move out
|
||||
|
@ -60,7 +60,7 @@ fn d() {
|
|||
}
|
||||
|
||||
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();
|
||||
match vec {
|
||||
[_a, _b, _c] => {} //~ ERROR cannot move out
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
fn test(cond: bool) {
|
||||
let v;
|
||||
while cond {
|
||||
v = 3i;
|
||||
v = 3is;
|
||||
break;
|
||||
}
|
||||
println!("{}", v); //~ ERROR use of possibly uninitialized variable: `v`
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
fn f() -> isize {
|
||||
let mut x: isize;
|
||||
while 1i == 1 { x = 10; }
|
||||
while 1is == 1 { x = 10; }
|
||||
return x; //~ ERROR use of possibly uninitialized variable: `x`
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,6 @@ impl <T: Sync> Foo for T { }
|
|||
|
||||
fn main() {
|
||||
let (tx, rx) = channel();
|
||||
1193182i.foo(tx);
|
||||
assert!(rx.recv() == 1193182i);
|
||||
1193182is.foo(tx);
|
||||
assert!(rx.recv() == 1193182is);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
let x = 1i;
|
||||
let x = 1is;
|
||||
move|:| { x = 2; };
|
||||
//~^ ERROR: cannot assign to immutable captured outer variable
|
||||
|
||||
|
|
|
@ -15,5 +15,5 @@ class cat : nonexistent {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let nyan = cat(0u);
|
||||
let nyan = cat(0us);
|
||||
}
|
||||
|
|
|
@ -27,5 +27,5 @@ fn cat(in_x : usize) -> cat {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let nyan = cat(0u);
|
||||
let nyan = cat(0us);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ impl cat {
|
|||
fn sleep(&self) { loop{} }
|
||||
fn meow(&self) {
|
||||
println!("Meow");
|
||||
meows += 1u; //~ ERROR unresolved name
|
||||
meows += 1us; //~ ERROR unresolved name
|
||||
sleep(); //~ ERROR unresolved name
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// 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
|
||||
|
||||
static B: usize = { { } 2 };
|
||||
|
@ -19,7 +19,7 @@ macro_rules! foo {
|
|||
}
|
||||
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
|
||||
|
||||
pub fn main() {
|
||||
|
|
|
@ -22,10 +22,10 @@ impl S { }
|
|||
impl T for S { }
|
||||
|
||||
#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs and enums
|
||||
static s: usize = 0u;
|
||||
static s: usize = 0us;
|
||||
|
||||
#[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
|
||||
mod m { }
|
||||
|
|
|
@ -27,17 +27,17 @@ fn main() {
|
|||
// if n > m, it's a type mismatch error.
|
||||
|
||||
// n < m
|
||||
let &x = &(&1i as &T);
|
||||
let &x = &&(&1i as &T);
|
||||
let &&x = &&(&1i as &T);
|
||||
let &x = &(&1is as &T);
|
||||
let &x = &&(&1is as &T);
|
||||
let &&x = &&(&1is as &T);
|
||||
|
||||
// n == m
|
||||
let &x = &1i as &T; //~ ERROR type `&T` cannot be dereferenced
|
||||
let &&x = &(&1i as &T); //~ ERROR type `&T` cannot be dereferenced
|
||||
let box x = box 1i as Box<T>; //~ ERROR type `Box<T>` cannot be dereferenced
|
||||
let &x = &1is as &T; //~ ERROR type `&T` cannot be dereferenced
|
||||
let &&x = &(&1is as &T); //~ ERROR type `&T` cannot be dereferenced
|
||||
let box x = box 1is as Box<T>; //~ ERROR type `Box<T>` cannot be dereferenced
|
||||
|
||||
// n > m
|
||||
let &&x = &1i as &T; //~ ERROR found &-ptr
|
||||
let &&&x = &(&1i as &T); //~ ERROR found &-ptr
|
||||
let box box x = box 1i as Box<T>; //~ ERROR found box
|
||||
let &&x = &1is as &T; //~ ERROR found &-ptr
|
||||
let &&&x = &(&1is as &T); //~ ERROR found &-ptr
|
||||
let box box x = box 1is as Box<T>; //~ ERROR found box
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ struct Fat<T: ?Sized> {
|
|||
}
|
||||
|
||||
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 h: &Fat<Fat<[isize]>> = &Fat { ptr: *g };
|
||||
//~^ ERROR the trait `core::marker::Sized` is not implemented
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
let x = [ 1i, 2, 3, 4, 5 ];
|
||||
let x = [ 1is, 2, 3, 4, 5 ];
|
||||
match x {
|
||||
[ xs.., 4, 5 ] => {} //~ ERROR multiple-element slice matches
|
||||
[ 1, xs.., 5 ] => {} //~ ERROR multiple-element slice matches
|
||||
|
|
|
@ -16,7 +16,7 @@ mod u {
|
|||
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 {
|
||||
|
@ -25,7 +25,7 @@ mod i {
|
|||
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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,5 +21,5 @@ fn main() {
|
|||
let _: () = (box |&mut:| -> isize unimplemented!()) as Box<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`
|
||||
}
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
|
||||
fn main() {
|
||||
for
|
||||
&1i //~ ERROR refutable pattern in `for` loop binding
|
||||
in [1i].iter() {}
|
||||
&1is //~ ERROR refutable pattern in `for` loop binding
|
||||
in [1is].iter() {}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
fn main() {
|
||||
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();
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
fn main() {
|
||||
let mut my_stuff = std::collections::HashMap::new();
|
||||
my_stuff.insert(0i, 42i);
|
||||
my_stuff.insert(0is, 42is);
|
||||
|
||||
let mut it = my_stuff.iter();
|
||||
my_stuff.insert(1, 43); //~ ERROR cannot borrow
|
||||
|
|
|
@ -20,20 +20,20 @@ fn macros() {
|
|||
}}
|
||||
}
|
||||
|
||||
foo!(a, 1i, { //~ ERROR irrefutable if-let
|
||||
foo!(a, 1is, { //~ ERROR irrefutable if-let
|
||||
println!("irrefutable pattern");
|
||||
});
|
||||
bar!(a, 1i, { //~ ERROR irrefutable if-let
|
||||
bar!(a, 1is, { //~ ERROR irrefutable if-let
|
||||
println!("irrefutable pattern");
|
||||
});
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
if let a = 1i { //~ ERROR irrefutable if-let
|
||||
if let a = 1is { //~ ERROR irrefutable if-let
|
||||
println!("irrefutable pattern");
|
||||
}
|
||||
|
||||
if let a = 1i { //~ ERROR irrefutable if-let
|
||||
if let a = 1is { //~ ERROR irrefutable if-let
|
||||
println!("irrefutable pattern");
|
||||
} else if true {
|
||||
println!("else-if in irrefutable if-let");
|
||||
|
@ -41,15 +41,15 @@ pub fn main() {
|
|||
println!("else in irrefutable if-let");
|
||||
}
|
||||
|
||||
if let 1i = 2i {
|
||||
if let 1is = 2is {
|
||||
println!("refutable pattern");
|
||||
} else if let a = 1i { //~ ERROR irrefutable if-let
|
||||
} else if let a = 1is { //~ ERROR irrefutable if-let
|
||||
println!("irrefutable pattern");
|
||||
}
|
||||
|
||||
if true {
|
||||
println!("if");
|
||||
} else if let a = 1i { //~ ERROR irrefutable if-let
|
||||
} else if let a = 1is { //~ ERROR irrefutable if-let
|
||||
println!("irrefutable pattern");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,5 +11,5 @@
|
|||
use std::num::SignedInt;
|
||||
|
||||
fn main() {
|
||||
let _f = 10i.abs; //~ ERROR attempted to take value of method
|
||||
let _f = 10is.abs; //~ ERROR attempted to take value of method
|
||||
}
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
mod circ1 {
|
||||
pub use circ2::f2;
|
||||
pub fn f1() { println!("f1"); }
|
||||
pub fn common() -> usize { return 0u; }
|
||||
pub fn common() -> usize { return 0us; }
|
||||
}
|
||||
|
||||
mod circ2 {
|
||||
pub use circ1::f1;
|
||||
pub fn f2() { println!("f2"); }
|
||||
pub fn common() -> usize { return 1u; }
|
||||
pub fn common() -> usize { return 1us; }
|
||||
}
|
||||
|
||||
mod test {
|
||||
|
|
|
@ -9,5 +9,5 @@
|
|||
// except according to those terms.
|
||||
|
||||
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
|
||||
}
|
||||
|
|
|
@ -28,11 +28,11 @@ impl<T:Clone> to_opt for Option<T> {
|
|||
}
|
||||
|
||||
fn function<T:to_opt + Clone>(counter: usize, t: T) {
|
||||
if counter > 0u {
|
||||
function(counter - 1u, t.to_option());
|
||||
if counter > 0us {
|
||||
function(counter - 1us, t.to_option());
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
function(22u, 22u);
|
||||
function(22us, 22us);
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
pub fn main() {
|
||||
let v: Vec<isize> = vec!(0, 1, 2, 3, 4, 5);
|
||||
let s: String = "abcdef".to_string();
|
||||
v.as_slice()[3u];
|
||||
v.as_slice()[3us];
|
||||
v.as_slice()[3];
|
||||
v.as_slice()[3u8]; //~ERROR the trait `core::ops::Index<u8>` is not implemented
|
||||
//~^ ERROR the trait `core::ops::Index<u8>` is not implemented
|
||||
|
@ -21,7 +21,7 @@ pub fn main() {
|
|||
//~^ ERROR the trait `core::ops::Index<u32>` is not implemented
|
||||
v.as_slice()[3i32]; //~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()[3u8]; //~ERROR the trait `core::ops::Index<u8>` is not implemented
|
||||
//~^ERROR the trait `core::ops::Index<u8>` is not implemented
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#![feature(box_syntax)]
|
||||
|
||||
fn main() {
|
||||
let x = box 1i;
|
||||
let x = box 1is;
|
||||
let f = move|:| {
|
||||
let _a = x;
|
||||
drop(x);
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
// This file must never have a trailing newline
|
||||
|
||||
fn main() {
|
||||
let x = Some(3i);
|
||||
let y = x.as_ref().unwrap_or(&5i); //~ ERROR: borrowed value does not live long enough
|
||||
let x = Some(3is);
|
||||
let y = x.as_ref().unwrap_or(&5is); //~ ERROR: borrowed value does not live long enough
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn blah() -> isize { //~ ERROR not all control paths return a value
|
||||
1i
|
||||
1is
|
||||
|
||||
; //~ HELP consider removing this semicolon:
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
let mut v = vec!(1i);
|
||||
let mut f = |&mut:| v.push(2i);
|
||||
let mut v = vec!(1is);
|
||||
let mut f = |&mut:| v.push(2is);
|
||||
let _w = v; //~ ERROR: cannot move out of `v`
|
||||
|
||||
f();
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
fn main() {
|
||||
let r = {
|
||||
let x = box 42i;
|
||||
let x = box 42is;
|
||||
let f = move|:| &x; //~ ERROR: `x` does not live long enough
|
||||
f()
|
||||
};
|
||||
|
|
|
@ -17,7 +17,7 @@ fn main() {
|
|||
loop {
|
||||
let tx = tx;
|
||||
//~^ ERROR: use of moved value: `tx`
|
||||
tx.send(1i);
|
||||
tx.send(1is);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -34,6 +34,6 @@ fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
|
|||
}
|
||||
|
||||
fn main() {
|
||||
check((3u, 5u));
|
||||
check((3us, 5us));
|
||||
//~^ ERROR mismatched types: expected `&_`, found `(usize, usize)` (expected &-ptr, found tuple)
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ fn main() {
|
|||
let x = [1,2];
|
||||
let y = match x {
|
||||
[] => 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)
|
||||
[a,_] => Some(a)
|
||||
};
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
// Regression test for issue #1362 - without that fix the span will be bogus
|
||||
// no-reformat
|
||||
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
|
||||
// on is significant; an error later in the source file might not
|
||||
|
|
|
@ -13,5 +13,5 @@
|
|||
fn foo(a: usize) -> usize { a }
|
||||
|
||||
fn main() {
|
||||
println!("{}", foo(10i)); //~ ERROR mismatched types
|
||||
println!("{}", foo(10is)); //~ ERROR mismatched types
|
||||
}
|
||||
|
|
|
@ -28,6 +28,6 @@ fn make_shower<T>(x: T) -> Shower<T> {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
let show3 = make_shower(3i);
|
||||
let show3 = make_shower(3is);
|
||||
show3();
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
macro_rules! f { () => (n) }
|
||||
|
||||
fn main() -> (){
|
||||
for n in range(0i, 1) {
|
||||
for n in range(0is, 1) {
|
||||
println!("{}", f!()); //~ ERROR unresolved name `n`
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
fn main() {
|
||||
let v = vec![
|
||||
&3i
|
||||
&3is
|
||||
//~^ ERROR borrowed value does not live long enough
|
||||
];
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ struct Foo {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let x = 1u;
|
||||
let x = 1us;
|
||||
let y: Foo;
|
||||
|
||||
// `x { ... }` should not be interpreted as a struct literal here
|
||||
|
|
|
@ -23,10 +23,10 @@ impl Drop for Enum {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let foo = X(1i);
|
||||
let foo = X(1is);
|
||||
drop(foo);
|
||||
match foo { //~ ERROR use of moved value
|
||||
X(1i) => (),
|
||||
X(1is) => (),
|
||||
_ => unreachable!()
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ enum Foo {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
match Foo::Bar(1i) {
|
||||
match Foo::Bar(1is) {
|
||||
Foo { i } => () //~ ERROR `Foo` does not name a struct or a struct variant
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,16 +11,16 @@
|
|||
#![feature(box_syntax)]
|
||||
|
||||
fn main() {
|
||||
let _foo = &[1u, 2] as [usize];
|
||||
let _foo = &[1us, 2] as [usize];
|
||||
//~^ ERROR cast to unsized type: `&[usize; 2]` as `[usize]`
|
||||
//~^^ 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`
|
||||
//~^^ 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`
|
||||
//~^^ 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]`
|
||||
//~^^ HELP consider using a box or reference as appropriate
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ static mut A2: usize = 1;
|
|||
const A3: usize = 1;
|
||||
|
||||
fn main() {
|
||||
match 1u {
|
||||
match 1us {
|
||||
A1 => {} //~ ERROR: static variables cannot be referenced in a pattern
|
||||
A2 => {} //~ ERROR: static variables cannot be referenced in a pattern
|
||||
A3 => {}
|
||||
|
|
|
@ -14,8 +14,8 @@ enum MyOption<T> {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
match MyOption::MySome(42i) {
|
||||
MyOption::MySome { x: 42i } => (),
|
||||
match MyOption::MySome(42is) {
|
||||
MyOption::MySome { x: 42is } => (),
|
||||
//~^ ERROR `MyOption::MySome` does not name a struct or a struct variant
|
||||
_ => (),
|
||||
}
|
||||
|
|
|
@ -15,14 +15,14 @@
|
|||
|
||||
#[cfg(any(all(stage0, target_word_size = "64"), all(not(stage0), target_pointer_width = "64")))]
|
||||
fn main() {
|
||||
let n = 0u;
|
||||
let a = box [&n; 0xF000000000000000u];
|
||||
let n = 0us;
|
||||
let a = box [&n; 0xF000000000000000us];
|
||||
println!("{}", a[0xFFFFFFu]);
|
||||
}
|
||||
|
||||
#[cfg(any(all(stage0, target_word_size = "32"), all(not(stage0), target_pointer_width = "32")))]
|
||||
fn main() {
|
||||
let n = 0u;
|
||||
let n = 0us;
|
||||
let a = box [&n; 0xFFFFFFFFu];
|
||||
println!("{}", a[0xFFFFFFu]);
|
||||
}
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub static X: usize = 1u;
|
||||
pub static X: usize = 1us;
|
||||
|
||||
fn main() {
|
||||
match 1u {
|
||||
match 1us {
|
||||
self::X => { },
|
||||
//~^ ERROR static variables cannot be referenced in a pattern, use a `const` instead
|
||||
_ => { },
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#![deny(unused_variables)]
|
||||
|
||||
fn main() {
|
||||
for _ in range(1i, 101) {
|
||||
for _ in range(1is, 101) {
|
||||
let x = (); //~ ERROR: unused variable: `x`
|
||||
match () {
|
||||
a => {} //~ ERROR: unused variable: `a`
|
||||
|
|
|
@ -16,7 +16,7 @@ fn _create_render(_: &()) ->
|
|||
AbstractRenderer
|
||||
//~^ ERROR: the trait `core::marker::Sized` is not implemented
|
||||
{
|
||||
match 0u {
|
||||
match 0us {
|
||||
_ => unimplemented!()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,5 +13,5 @@ enum Foo {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let f = Foo::Variant(42u); //~ ERROR uses it like a function
|
||||
let f = Foo::Variant(42us); //~ ERROR uses it like a function
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ impl Tr for usize {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let s = &mut 1u;
|
||||
let s = &mut 1us;
|
||||
|
||||
MyPtr(s).poke(s);
|
||||
//~^ ERROR cannot borrow `*s` as mutable more than once at a time
|
||||
|
|
|
@ -14,7 +14,7 @@ use std::cell::RefCell;
|
|||
|
||||
fn main() {
|
||||
let c = RefCell::new(vec![]);
|
||||
let mut y = 1u;
|
||||
let mut y = 1us;
|
||||
c.push(box || y = 0);
|
||||
c.push(box || y = 0);
|
||||
//~^ ERROR cannot borrow `y` as mutable more than once at a time
|
||||
|
@ -22,7 +22,7 @@ fn main() {
|
|||
|
||||
fn ufcs() {
|
||||
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);
|
||||
|
|
|
@ -17,7 +17,7 @@ impl Foo for Thing {
|
|||
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() {
|
||||
let mut thing = Thing;
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
let t = (42i, 42i);
|
||||
let t = (42is, 42is);
|
||||
t.0::<isize>; //~ ERROR expected one of `.`, `;`, `}`, or an operator, found `::`
|
||||
}
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
|
||||
// compile-flags: -D while-true
|
||||
fn main() {
|
||||
let mut i = 0i;
|
||||
let mut i = 0is;
|
||||
while true { //~ ERROR denote infinite loops with loop
|
||||
i += 1i;
|
||||
if i == 5i { break; }
|
||||
i += 1is;
|
||||
if i == 5is { break; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
fn fail_len(v: Vec<isize> ) -> usize {
|
||||
let mut i = 3;
|
||||
panic!();
|
||||
for x in v.iter() { i += 1u; }
|
||||
for x in v.iter() { i += 1us; }
|
||||
//~^ ERROR: unreachable statement
|
||||
return i;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ struct Obj {
|
|||
|
||||
impl Obj {
|
||||
pub fn boom() -> bool {
|
||||
return 1i+1 == 2
|
||||
return 1is+1 == 2
|
||||
}
|
||||
pub fn chirp(&self) {
|
||||
self.boom(); //~ ERROR `&Obj` does not implement any method in scope named `boom`
|
||||
|
@ -24,5 +24,5 @@ impl Obj {
|
|||
fn main() {
|
||||
let o = Obj { member: 0 };
|
||||
o.chirp();
|
||||
1i + 1;
|
||||
1is + 1;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,6 @@ fn f<'r, T>(v: &'r T) -> Box<FnMut() -> T + 'r> {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let v = &5i;
|
||||
let v = &5is;
|
||||
println!("{}", f(v).call_mut(()));
|
||||
}
|
||||
|
|
|
@ -30,17 +30,17 @@ trait UnusedTrait {
|
|||
|
||||
impl CtxtFn for usize {
|
||||
fn f8(self, i: usize) -> usize {
|
||||
i * 4u
|
||||
i * 4us
|
||||
}
|
||||
|
||||
fn f9(i: usize) -> usize {
|
||||
i * 4u
|
||||
i * 4us
|
||||
}
|
||||
}
|
||||
|
||||
impl OtherTrait for usize {
|
||||
fn f9(i: usize) -> usize {
|
||||
i * 8u
|
||||
i * 8us
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ impl<T:Copy> Foo for T {
|
|||
fn take_param<T:Foo>(foo: &T) { }
|
||||
|
||||
fn main() {
|
||||
let x = box 3i;
|
||||
let x = box 3is;
|
||||
take_param(&x);
|
||||
//~^ ERROR the trait `core::marker::Copy` is not implemented
|
||||
}
|
||||
|
|
|
@ -23,12 +23,12 @@ impl<T:Copy> Foo for T {
|
|||
fn take_param<T:Foo>(foo: &T) { }
|
||||
|
||||
fn a() {
|
||||
let x = box 3i;
|
||||
let x = box 3is;
|
||||
take_param(&x); //~ ERROR `core::marker::Copy` is not implemented
|
||||
}
|
||||
|
||||
fn b() {
|
||||
let x = box 3i;
|
||||
let x = box 3is;
|
||||
let y = &x;
|
||||
let z = &x as &Foo; //~ ERROR `core::marker::Copy` is not implemented
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ fn foo(_x: Rc<usize>) {}
|
|||
fn bar<F:FnOnce() + Send>(_: F) { }
|
||||
|
||||
fn main() {
|
||||
let x = Rc::new(3u);
|
||||
let x = Rc::new(3us);
|
||||
bar(move|| foo(x));
|
||||
//~^ ERROR `core::marker::Send` is not implemented
|
||||
//~^^ ERROR `core::marker::Send` is not implemented
|
||||
|
|
|
@ -90,7 +90,7 @@ pub fn pub_fn() {
|
|||
let e = used_enum::foo3;
|
||||
SemiUsedStruct::la_la_la();
|
||||
|
||||
let i = 1i;
|
||||
let i = 1is;
|
||||
match i {
|
||||
USED_STATIC => (),
|
||||
USED_CONST => (),
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue