mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Fix pattern type mismatch in tuples
This commit is contained in:
parent
9811a3af5f
commit
36c9d5ce17
13 changed files with 139 additions and 45 deletions
|
@ -30,7 +30,7 @@ pub(super) fn hints(
|
|||
|
||||
let descended = sema.descend_node_into_attributes(pat.clone()).pop();
|
||||
let desc_pat = descended.as_ref().unwrap_or(pat);
|
||||
let ty = sema.type_of_pat(&desc_pat.clone().into())?.original;
|
||||
let ty = sema.type_of_binding_in_pat(desc_pat)?;
|
||||
|
||||
if should_not_display_type_hint(sema, config, pat, &ty) {
|
||||
return None;
|
||||
|
|
|
@ -148,7 +148,6 @@ struct Struct {
|
|||
field: &'static str,
|
||||
}
|
||||
fn foo(s @ Struct { field, .. }: &Struct) {}
|
||||
//^^^^^^^^^^^^^^^^^^^^^^^^ref
|
||||
//^^^^^^^^^^^^^^^^^^^^&
|
||||
//^^^^^ref
|
||||
"#,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue