Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adapt stderr of UI test to PR #48449
  • Loading branch information
flip1995 committed Mar 1, 2018
commit f45f760f624b34a7fa70fe925303808d4713641a
16 changes: 8 additions & 8 deletions src/test/ui/lint/type-overflow.stderr
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
warning: literal out of range for i8
--> $DIR/type-overflow.rs:16:17
|
16 | let error = 255i8; //~WARNING literal out of range for i8
LL | let error = 255i8; //~WARNING literal out of range for i8
| ^^^^^
|
= note: #[warn(overflowing_literals)] on by default

warning: literal out of range for i8
--> $DIR/type-overflow.rs:21:16
|
21 | let fail = 0b1000_0001i8; //~WARNING literal out of range for i8
LL | let fail = 0b1000_0001i8; //~WARNING literal out of range for i8
| ^^^^^^^^^^^^^ help: consider using `u8` instead: `0b1000_0001u8`
|
= note: the literal `0b1000_0001i8` (decimal `129`) does not fit into an `i8` and will become `-127i8`

warning: literal out of range for i64
--> $DIR/type-overflow.rs:23:16
|
23 | let fail = 0x8000_0000_0000_0000i64; //~WARNING literal out of range for i64
LL | let fail = 0x8000_0000_0000_0000i64; //~WARNING literal out of range for i64
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `u64` instead: `0x8000_0000_0000_0000u64`
|
= note: the literal `0x8000_0000_0000_0000i64` (decimal `9223372036854775808`) does not fit into an `i64` and will become `-9223372036854775808i64`

warning: literal out of range for u32
--> $DIR/type-overflow.rs:25:16
|
25 | let fail = 0x1_FFFF_FFFFu32; //~WARNING literal out of range for u32
LL | let fail = 0x1_FFFF_FFFFu32; //~WARNING literal out of range for u32
| ^^^^^^^^^^^^^^^^ help: consider using `u64` instead: `0x1_FFFF_FFFFu64`
|
= note: the literal `0x1_FFFF_FFFFu32` (decimal `8589934591`) does not fit into an `u32` and will become `4294967295u32`

warning: literal out of range for i128
--> $DIR/type-overflow.rs:27:22
|
27 | let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000;
LL | let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the literal `0x8000_0000_0000_0000_0000_0000_0000_0000` (decimal `170141183460469231731687303715884105728`) does not fit into an `i128` and will become `-170141183460469231731687303715884105728i128`
Expand All @@ -42,7 +42,7 @@ warning: literal out of range for i128
warning: literal out of range for i32
--> $DIR/type-overflow.rs:30:16
|
30 | let fail = 0x8FFF_FFFF_FFFF_FFFE; //~WARNING literal out of range for i32
LL | let fail = 0x8FFF_FFFF_FFFF_FFFE; //~WARNING literal out of range for i32
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: the literal `0x8FFF_FFFF_FFFF_FFFE` (decimal `10376293541461622782`) does not fit into an `i32` and will become `-2i32`
Expand All @@ -51,15 +51,15 @@ warning: literal out of range for i32
warning: literal out of range for isize
--> $DIR/type-overflow.rs:32:23
|
32 | let fail: isize = 0x8000_0000_0000_0000; //~WARNING literal out of range for isize
LL | let fail: isize = 0x8000_0000_0000_0000; //~WARNING literal out of range for isize
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: the literal `0x8000_0000_0000_0000` (decimal `9223372036854775808`) does not fit into an `isize` and will become `-9223372036854775808isize`

warning: literal out of range for i8
--> $DIR/type-overflow.rs:34:17
|
34 | let fail = -0b1111_1111i8; //~WARNING literal out of range for i8
LL | let fail = -0b1111_1111i8; //~WARNING literal out of range for i8
| ^^^^^^^^^^^^^ help: consider using `i16` instead: `0b1111_1111i16`
|
= note: the literal `0b1111_1111i8` (decimal `255`) does not fit into an `i8` and will become `-1i8`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note says that the literal will become -1i8 (which is technically correct), while fail will have the value 1i8 due to the negation. That is, because I ignore whether the literal is negated in the generation of the note.

I'm not sure if I should change this because it is correct for the given span.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this is fine for now. Filed #48535 to follow up.

Expand Down