@@ -18,42 +18,43 @@ fn test(x: i8) {
18
18
#[ allow( unused_variables) ]
19
19
fn main ( ) {
20
20
let x1: u8 = 255 ; // should be OK
21
- let x1: u8 = 256 ; //~ error: literal out of range for its type
21
+ let x1: u8 = 256 ; //~ error: literal out of range for u8
22
22
23
23
let x1 = 255_u8 ; // should be OK
24
- let x1 = 256_u8 ; //~ error: literal out of range for its type
24
+ let x1 = 256_u8 ; //~ error: literal out of range for u8
25
25
26
26
let x2: i8 = -128 ; // should be OK
27
- let x1: i8 = 128 ; //~ error: literal out of range for its type
28
- let x2: i8 = --128 ; //~ error: literal out of range for its type
27
+ let x1: i8 = 128 ; //~ error: literal out of range for i8
28
+ let x2: i8 = --128 ; //~ error: literal out of range for i8
29
29
30
- let x3: i8 = -129 ; //~ error: literal out of range for its type
31
- let x3: i8 = -( 129 ) ; //~ error: literal out of range for its type
32
- let x3: i8 = -{ 129 } ; //~ error: literal out of range for its type
30
+ let x3: i8 = -129 ; //~ error: literal out of range for i8
31
+ let x3: i8 = -( 129 ) ; //~ error: literal out of range for i8
32
+ let x3: i8 = -{ 129 } ; //~ error: literal out of range for i8
33
33
34
- test ( 1000 ) ; //~ error: literal out of range for its type
34
+ test ( 1000 ) ; //~ error: literal out of range for i8
35
35
36
- let x = 128_i8 ; //~ error: literal out of range for its type
36
+ let x = 128_i8 ; //~ error: literal out of range for i8
37
37
let x = 127_i8 ;
38
38
let x = -128_i8 ;
39
39
let x = -( 128_i8 ) ;
40
- let x = -129_i8 ; //~ error: literal out of range for its type
40
+ let x = -129_i8 ; //~ error: literal out of range for i8
41
41
42
42
let x: i32 = 2147483647 ; // should be OK
43
43
let x = 2147483647_i32 ; // should be OK
44
- let x: i32 = 2147483648 ; //~ error: literal out of range for its type
45
- let x = 2147483648_i32 ; //~ error: literal out of range for its type
44
+ let x: i32 = 2147483648 ; //~ error: literal out of range for i32
45
+ let x = 2147483648_i32 ; //~ error: literal out of range for i32
46
46
let x: i32 = -2147483648 ; // should be OK
47
47
let x = -2147483648_i32 ; // should be OK
48
- let x: i32 = -2147483649 ; //~ error: literal out of range for its type
49
- let x = -2147483649_i32 ; //~ error: literal out of range for its type
48
+ let x: i32 = -2147483649 ; //~ error: literal out of range for i32
49
+ let x = -2147483649_i32 ; //~ error: literal out of range for i32
50
+ let x = 2147483648 ; //~ error: literal out of range for i32
50
51
51
- let x = 9223372036854775808_i64 ; //~ error: literal out of range for its type
52
+ let x = 9223372036854775808_i64 ; //~ error: literal out of range for i64
52
53
let x = -9223372036854775808_i64 ; // should be OK
53
- let x = 18446744073709551615_i64 ; //~ error: literal out of range for its type
54
+ let x = 18446744073709551615_i64 ; //~ error: literal out of range for i64
54
55
55
- let x = -3.40282348e+38_f32 ; //~ error: literal out of range for its type
56
- let x = 3.40282348e+38_f32 ; //~ error: literal out of range for its type
57
- let x = -1.7976931348623159e+308_f64 ; //~ error: literal out of range for its type
58
- let x = 1.7976931348623159e+308_f64 ; //~ error: literal out of range for its type
56
+ let x = -3.40282348e+38_f32 ; //~ error: literal out of range for f32
57
+ let x = 3.40282348e+38_f32 ; //~ error: literal out of range for f32
58
+ let x = -1.7976931348623159e+308_f64 ; //~ error: literal out of range for f64
59
+ let x = 1.7976931348623159e+308_f64 ; //~ error: literal out of range for f64
59
60
}
0 commit comments