mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 05:13:35 +00:00
Show pattern mismatch diagnostics
This commit is contained in:
parent
9b441b9c67
commit
fc2b395e00
8 changed files with 117 additions and 71 deletions
|
|
@ -1092,3 +1092,19 @@ fn my_fn(foo: ...) {}
|
|||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ref_pat_mutability() {
|
||||
check(
|
||||
r#"
|
||||
fn foo() {
|
||||
let &() = &();
|
||||
let &mut () = &mut ();
|
||||
let &mut () = &();
|
||||
//^^^^^^^ expected &(), got &mut ()
|
||||
let &() = &mut ();
|
||||
//^^^ expected &mut (), got &()
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue