Skip to content

Commit

Permalink
add run-rustfix
Browse files Browse the repository at this point in the history
  • Loading branch information
mu001999 committed Mar 29, 2023
1 parent 910a5ad commit dde26b3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions tests/ui/lint/issue-109529.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// run-rustfix

fn main() {
for _ in 0..=255 as u8 {} //~ ERROR range endpoint is out of range
for _ in 0..=(255 as u8) {} //~ ERROR range endpoint is out of range
}
2 changes: 2 additions & 0 deletions tests/ui/lint/issue-109529.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// run-rustfix

fn main() {
for _ in 0..256 as u8 {} //~ ERROR range endpoint is out of range
for _ in 0..(256 as u8) {} //~ ERROR range endpoint is out of range
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/lint/issue-109529.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: range endpoint is out of range for `u8`
--> $DIR/issue-109529.rs:2:14
--> $DIR/issue-109529.rs:4:14
|
LL | for _ in 0..256 as u8 {}
| ------^^^^^^
Expand All @@ -9,7 +9,7 @@ LL | for _ in 0..256 as u8 {}
= note: `#[deny(overflowing_literals)]` on by default

error: range endpoint is out of range for `u8`
--> $DIR/issue-109529.rs:3:14
--> $DIR/issue-109529.rs:5:14
|
LL | for _ in 0..(256 as u8) {}
| ^^^^^^^^^^^^^^
Expand Down

0 comments on commit dde26b3

Please sign in to comment.