-
Notifications
You must be signed in to change notification settings - Fork 13.2k
/
Copy pathno-inline-literals-out-of-range.stderr
56 lines (50 loc) · 2.51 KB
/
no-inline-literals-out-of-range.stderr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
error: literal out of range for `i8`
--> $DIR/no-inline-literals-out-of-range.rs:4:24
|
LL | format_args!("{}", 0x8f_i8); // issue #115423
| ^^^^^^^
|
= note: the literal `0x8f_i8` (decimal `143`) does not fit into the type `i8` and will become `-113i8`
= note: `#[deny(overflowing_literals)]` on by default
help: consider using the type `u8` instead
|
LL | format_args!("{}", 0x8f_u8); // issue #115423
| ~~~~~~~
help: to use as a negative number (decimal `-113`), consider using the type `u8` for the literal and cast it to `i8`
|
LL | format_args!("{}", 0x8f_u8 as i8); // issue #115423
| ~~~~~~~~~~~~~
error: literal out of range for `u8`
--> $DIR/no-inline-literals-out-of-range.rs:6:24
|
LL | format_args!("{}", 0xffff_ffff_u8); // issue #116633
| ^^^^^^^^^^^^^^ help: consider using the type `u32` instead: `0xffff_ffff_u32`
|
= note: the literal `0xffff_ffff_u8` (decimal `4294967295`) does not fit into the type `u8` and will become `255u8`
error: literal out of range for `usize`
--> $DIR/no-inline-literals-out-of-range.rs:8:24
|
LL | format_args!("{}", 0xffff_ffff_ffff_ffff_ffff_usize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the literal `0xffff_ffff_ffff_ffff_ffff_usize` (decimal `1208925819614629174706175`) does not fit into the type `usize` and will become `18446744073709551615usize`
error: literal out of range for `isize`
--> $DIR/no-inline-literals-out-of-range.rs:10:24
|
LL | format_args!("{}", 0x8000_0000_0000_0000_isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the literal `0x8000_0000_0000_0000_isize` (decimal `9223372036854775808`) does not fit into the type `isize` and will become `-9223372036854775808isize`
error: literal out of range for `i32`
--> $DIR/no-inline-literals-out-of-range.rs:12:24
|
LL | format_args!("{}", 0xffff_ffff); // treat unsuffixed literals as i32
| ^^^^^^^^^^^
|
= note: the literal `0xffff_ffff` (decimal `4294967295`) does not fit into the type `i32` and will become `-1i32`
= help: consider using the type `u32` instead
help: to use as a negative number (decimal `-1`), consider using the type `u32` for the literal and cast it to `i32`
|
LL | format_args!("{}", 0xffff_ffffu32 as i32); // treat unsuffixed literals as i32
| ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 5 previous errors