Remove i, is, u, or us suffixes that are not necessary.
This commit is contained in:
parent
700c518f2a
commit
2b5720a15f
54 changed files with 174 additions and 174 deletions
|
|
@ -14,4 +14,4 @@ fn bad_bang(i: usize) -> ! {
|
|||
return 7us; //~ ERROR `return` in a function declared as diverging [E0166]
|
||||
}
|
||||
|
||||
fn main() { bad_bang(5us); }
|
||||
fn main() { bad_bang(5); }
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@ fn bad_bang(i: usize) -> ! { //~ ERROR computation may converge in a function ma
|
|||
if i < 0us { } else { panic!(); }
|
||||
}
|
||||
|
||||
fn main() { bad_bang(5us); }
|
||||
fn main() { bad_bang(5); }
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@
|
|||
use std::iter::repeat;
|
||||
|
||||
fn main() {
|
||||
let mut vector = vec![1us, 2];
|
||||
let mut vector = vec![1, 2];
|
||||
for &x in &vector {
|
||||
let cap = vector.capacity();
|
||||
vector.extend(repeat(0)); //~ ERROR cannot borrow
|
||||
vector[1us] = 5us; //~ ERROR cannot borrow
|
||||
vector[1] = 5; //~ ERROR cannot borrow
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@ fn bad_bang(i: usize) -> ! { //~ ERROR computation may converge in a function ma
|
|||
println!("{}", 3);
|
||||
}
|
||||
|
||||
fn main() { bad_bang(5us); }
|
||||
fn main() { bad_bang(5); }
|
||||
|
|
|
|||
|
|
@ -15,21 +15,21 @@
|
|||
//error-pattern: unreachable
|
||||
|
||||
fn main() {
|
||||
match 5us {
|
||||
1us ... 10us => { }
|
||||
5us ... 6us => { }
|
||||
match 5 {
|
||||
1 ... 10 => { }
|
||||
5 ... 6 => { }
|
||||
_ => {}
|
||||
};
|
||||
|
||||
match 5us {
|
||||
3us ... 6us => { }
|
||||
4us ... 6us => { }
|
||||
match 5 {
|
||||
3 ... 6 => { }
|
||||
4 ... 6 => { }
|
||||
_ => {}
|
||||
};
|
||||
|
||||
match 5us {
|
||||
4us ... 6us => { }
|
||||
4us ... 6us => { }
|
||||
match 5 {
|
||||
4 ... 6 => { }
|
||||
4 ... 6 => { }
|
||||
_ => {}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
//error-pattern: mismatched types
|
||||
|
||||
fn main() {
|
||||
match 5us {
|
||||
6us ... 1us => { }
|
||||
match 5 {
|
||||
6 ... 1 => { }
|
||||
_ => { }
|
||||
};
|
||||
|
||||
|
|
@ -22,8 +22,8 @@ fn main() {
|
|||
"bar" ... "foo" => { }
|
||||
};
|
||||
|
||||
match 5us {
|
||||
'c' ... 100us => { }
|
||||
match 5 {
|
||||
'c' ... 100 => { }
|
||||
_ => { }
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
fn test() -> _ { 5 }
|
||||
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
|
||||
|
||||
fn test2() -> (_, _) { (5us, 5us) }
|
||||
fn test2() -> (_, _) { (5, 5) }
|
||||
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
|
||||
//~^^ ERROR the type placeholder `_` is not allowed within types on item signatures
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ pub fn main() {
|
|||
fn fn_test() -> _ { 5 }
|
||||
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
|
||||
|
||||
fn fn_test2() -> (_, _) { (5us, 5us) }
|
||||
fn fn_test2() -> (_, _) { (5, 5) }
|
||||
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
|
||||
//~^^ ERROR the type placeholder `_` is not allowed within types on item signatures
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,6 @@ struct Foo<'a, T:'a> {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
let c: Foo<_, _> = Foo { r: &5us };
|
||||
let c: Foo<_, _> = Foo { r: &5 };
|
||||
//~^ ERROR wrong number of type arguments: expected 1, found 2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,8 +83,8 @@ pub type Foo = [i32; (3us as usize)];
|
|||
pub struct Bar {
|
||||
pub x: [i32; (3us as usize)],
|
||||
}
|
||||
pub struct TupleBar([i32; (4us as usize)]);
|
||||
pub enum Baz { BazVariant([i32; (5us as usize)]), }
|
||||
pub struct TupleBar([i32; (4 as usize)]);
|
||||
pub enum Baz { BazVariant([i32; (5 as usize)]), }
|
||||
pub fn id<T>(x: T) -> T { (x as T) }
|
||||
pub fn use_id() {
|
||||
let _ =
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
pub fn foo(_: [i32; 3]) {}
|
||||
|
||||
pub fn bar() {
|
||||
const FOO: usize = 5us - 4us;
|
||||
const FOO: usize = 5 - 4;
|
||||
let _: [(); FOO] = [()];
|
||||
|
||||
let _ : [(); 1us] = [()];
|
||||
|
|
@ -27,22 +27,22 @@ pub fn bar() {
|
|||
format!("test");
|
||||
}
|
||||
|
||||
pub type Foo = [i32; 3us];
|
||||
pub type Foo = [i32; 3];
|
||||
|
||||
pub struct Bar {
|
||||
pub x: [i32; 3us]
|
||||
pub x: [i32; 3]
|
||||
}
|
||||
|
||||
pub struct TupleBar([i32; 4us]);
|
||||
pub struct TupleBar([i32; 4]);
|
||||
|
||||
pub enum Baz {
|
||||
BazVariant([i32; 5us])
|
||||
BazVariant([i32; 5])
|
||||
}
|
||||
|
||||
pub fn id<T>(x: T) -> T { x }
|
||||
|
||||
pub fn use_id() {
|
||||
let _ = id::<[i32; 3us]>([1,2,3]);
|
||||
let _ = id::<[i32; 3]>([1,2,3]);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ use sub::sub2 as msalias;
|
|||
use sub::sub2;
|
||||
use std::old_io::stdio::println;
|
||||
|
||||
static yy: usize = 25us;
|
||||
static yy: usize = 25;
|
||||
|
||||
mod sub {
|
||||
pub mod sub2 {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ use std::num::{from_int,from_i8,from_i32};
|
|||
use std::mem::size_of;
|
||||
|
||||
static uni: &'static str = "Les Miséééééééérables";
|
||||
static yy: usize = 25us;
|
||||
static yy: usize = 25;
|
||||
|
||||
static bob: Option<std::vec::CowVec<'static, isize>> = None;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
fn main() {
|
||||
let x = 5us;
|
||||
let x = 5;
|
||||
let command = Arc::new(Box::new(|| { x*2 }));
|
||||
assert_eq!(command(), 10);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue