@@ -465,13 +465,9 @@ An _integer literal_ has one of four forms:
465465
466466Like any literal, an integer literal may be followed (immediately,
467467without any spaces) by an _ integer suffix_ , which forcibly sets the
468- type of the literal. There are 10 valid values for an integer suffix:
469-
470- * Each of the signed and unsigned machine types ` u8 ` , ` i8 ` ,
471- ` u16 ` , ` i16 ` , ` u32 ` , ` i32 ` , ` u64 ` and ` i64 `
472- give the literal the corresponding machine type.
473- * The ` is ` and ` us ` suffixes give the literal type ` isize ` or ` usize ` ,
474- respectively.
468+ type of the literal. The integer suffix must be the name of one of the
469+ integral types: ` u8 ` , ` i8 ` , ` u16 ` , ` i16 ` , ` u32 ` , ` i32 ` , ` u64 ` , ` i64 ` ,
470+ ` isize ` , or ` usize ` .
475471
476472The type of an _ unsuffixed_ integer literal is determined by type inference.
477473If an integer type can be _ uniquely_ determined from the surrounding program
@@ -489,7 +485,7 @@ Examples of integer literals of various forms:
4894850xff_u8; // type u8
4904860o70_i16; // type i16
4914870b1111_1111_1001_0000_i32; // type i32
492- 0us; // type usize
488+ 0usize; // type usize
493489```
494490
495491##### Floating-point literals
@@ -1001,8 +997,8 @@ fn foo<T>(_: T){}
1001997fn bar(map1: HashMap<String, usize>, map2: hash_map::HashMap<String, usize>){}
1002998
1003999fn main() {
1004- // Equivalent to 'std::iter::range_step(0us , 10, 2);'
1005- range_step(0us , 10, 2);
1000+ // Equivalent to 'std::iter::range_step(0 , 10, 2);'
1001+ range_step(0 , 10, 2);
10061002
10071003 // Equivalent to 'foo(vec![std::option::Option::Some(1.0f64),
10081004 // std::option::Option::None]);'
@@ -3126,7 +3122,7 @@ conditional expression evaluates to `false`, the `while` expression completes.
31263122An example:
31273123
31283124```
3129- let mut i = 0us ;
3125+ let mut i = 0 ;
31303126
31313127while i < 10 {
31323128 println!("hello");
@@ -3206,7 +3202,7 @@ An example of a for loop over a series of integers:
32063202
32073203```
32083204# fn bar(b:usize) { }
3209- for i in 0us ..256 {
3205+ for i in 0 ..256 {
32103206 bar(i);
32113207}
32123208```
0 commit comments