rust/tests/ui/unnecessary_semicolon.fixed
2025-01-19 15:34:07 +01:00

32 lines
532 B
Rust

#![warn(clippy::unnecessary_semicolon)]
#![feature(postfix_match)]
fn no_lint(mut x: u32) -> Option<u32> {
Some(())?;
{
let y = 3;
dbg!(x + y)
};
{
let (mut a, mut b) = (10, 20);
(a, b) = (b + 1, a + 1);
}
Some(0)
}
fn main() {
let mut a = 3;
if a == 2 {
println!("This is weird");
}
//~^ ERROR: unnecessary semicolon
a.match {
3 => println!("three"),
_ => println!("not three"),
}
//~^ ERROR: unnecessary semicolon
}