Fix pattern type mismatch in tuples

This commit is contained in:
hkalbasi 2023-05-04 16:03:36 +03:30
parent 9811a3af5f
commit 36c9d5ce17
13 changed files with 139 additions and 45 deletions

View file

@ -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;

View file

@ -148,7 +148,6 @@ struct Struct {
field: &'static str,
}
fn foo(s @ Struct { field, .. }: &Struct) {}
//^^^^^^^^^^^^^^^^^^^^^^^^ref
//^^^^^^^^^^^^^^^^^^^^&
//^^^^^ref
"#,