mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Fix missing terminator in pattern matching of consts
This commit is contained in:
parent
aa52cbf784
commit
42d35f8af9
2 changed files with 22 additions and 1 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue