mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-27 20:35:09 +00:00
fix: replace errors in a type when doing autoderef
This commit is contained in:
parent
11aed78e2b
commit
f222665ebe
1 changed files with 2 additions and 4 deletions
|
@ -2504,9 +2504,8 @@ impl Type {
|
||||||
|
|
||||||
pub fn autoderef<'a>(&'a self, db: &'a dyn HirDatabase) -> impl Iterator<Item = Type> + 'a {
|
pub fn autoderef<'a>(&'a self, db: &'a dyn HirDatabase) -> impl Iterator<Item = Type> + 'a {
|
||||||
// There should be no inference vars in types passed here
|
// There should be no inference vars in types passed here
|
||||||
// FIXME check that?
|
let ty = hir_ty::replace_errors_with_variables(&self.ty).value;
|
||||||
let canonical =
|
let canonical = Canonical { value: ty, binders: CanonicalVarKinds::empty(&Interner) };
|
||||||
Canonical { value: self.ty.clone(), binders: CanonicalVarKinds::empty(&Interner) };
|
|
||||||
let environment = self.env.env.clone();
|
let environment = self.env.env.clone();
|
||||||
let ty = InEnvironment { goal: canonical, environment };
|
let ty = InEnvironment { goal: canonical, environment };
|
||||||
autoderef(db, Some(self.krate), ty)
|
autoderef(db, Some(self.krate), ty)
|
||||||
|
@ -2600,7 +2599,6 @@ impl Type {
|
||||||
callback: &mut dyn FnMut(&Ty, AssocItemId) -> ControlFlow<()>,
|
callback: &mut dyn FnMut(&Ty, AssocItemId) -> ControlFlow<()>,
|
||||||
) {
|
) {
|
||||||
// There should be no inference vars in types passed here
|
// There should be no inference vars in types passed here
|
||||||
// FIXME check that?
|
|
||||||
let canonical = hir_ty::replace_errors_with_variables(&self.ty);
|
let canonical = hir_ty::replace_errors_with_variables(&self.ty);
|
||||||
|
|
||||||
let env = self.env.clone();
|
let env = self.env.clone();
|
||||||
|
|
Loading…
Reference in a new issue