add run-rustfix

This commit is contained in:
Mu42 2023-03-29 09:56:28 +08:00
parent 910a5ad2df
commit dde26b31b6
3 changed files with 10 additions and 2 deletions

View File

@ -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
}

View File

@ -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

View File

@ -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 {}
| ------^^^^^^
@ -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) {}
| ^^^^^^^^^^^^^^