Fix missing terminator in pattern matching of consts

This commit is contained in:
hkalbasi 2023-07-10 01:01:59 +03:30
parent aa52cbf784
commit 42d35f8af9
2 changed files with 22 additions and 1 deletions

View file

@ -795,6 +795,22 @@ fn main() {
//^^^^^ 💡 warn: variable does not need to be mutable
f(x);
}
"#,
);
check_diagnostics(
r#"
struct Foo(i32);
const X: Foo = Foo(5);
const Y: Foo = Foo(12);
const fn f(mut a: Foo) -> bool {
//^^^^^ 💡 warn: variable does not need to be mutable
match a {
X | Y => true,
_ => false,
}
}
"#,
);
}