rust/tests/ui/for-loop-while/while-loop-constraints-2.rs
Esteban Küber 3815ed63ed Remove some unnecessary parens in assert! conditions
While working on #122661, some of these started triggering our "unnecessary parens" lints due to a change in the `assert!` desugaring. A cursory search identified a few more. Some of these have been carried from before 1.0, were a bulk rename from the previous name of `assert!` left them in that state. I went and removed as many of these unnecessary parens as possible in order to have fewer annoyances in the future if we make the lint smarter.
2025-02-06 22:28:44 +00:00

16 lines
305 B
Rust

//@ run-pass
#![allow(unused_assignments)]
#![allow(unused_variables)]
pub fn main() {
let mut y: isize = 42;
let mut z: isize = 42;
let mut x: isize;
while z < 50 {
z += 1;
while false { x = y; y = z; }
println!("{}", y);
}
assert!(y == 42 && z == 50);
}