From dde26b31b6b625496e8dc0933e231c27f35b8933 Mon Sep 17 00:00:00 2001 From: Mu42 Date: Wed, 29 Mar 2023 09:56:28 +0800 Subject: [PATCH] add run-rustfix --- tests/ui/lint/issue-109529.fixed | 6 ++++++ tests/ui/lint/issue-109529.rs | 2 ++ tests/ui/lint/issue-109529.stderr | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 tests/ui/lint/issue-109529.fixed diff --git a/tests/ui/lint/issue-109529.fixed b/tests/ui/lint/issue-109529.fixed new file mode 100644 index 00000000000..5ad489073ee --- /dev/null +++ b/tests/ui/lint/issue-109529.fixed @@ -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 +} diff --git a/tests/ui/lint/issue-109529.rs b/tests/ui/lint/issue-109529.rs index c9b4da4b26e..383d7bc4cf3 100644 --- a/tests/ui/lint/issue-109529.rs +++ b/tests/ui/lint/issue-109529.rs @@ -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 diff --git a/tests/ui/lint/issue-109529.stderr b/tests/ui/lint/issue-109529.stderr index 15b259ad55e..9e857d1b0ab 100644 --- a/tests/ui/lint/issue-109529.stderr +++ b/tests/ui/lint/issue-109529.stderr @@ -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) {} | ^^^^^^^^^^^^^^