fix: replace errors in receiver type when iterating method candidates
This commit is contained in:
@@ -2601,9 +2601,7 @@ impl Type {
|
|||||||
) {
|
) {
|
||||||
// There should be no inference vars in types passed here
|
// There should be no inference vars in types passed here
|
||||||
// FIXME check that?
|
// FIXME check that?
|
||||||
// FIXME replace Unknown by bound vars here
|
let canonical = hir_ty::replace_errors_with_variables(&self.ty);
|
||||||
let canonical =
|
|
||||||
Canonical { value: self.ty.clone(), binders: CanonicalVarKinds::empty(&Interner) };
|
|
||||||
|
|
||||||
let env = self.env.clone();
|
let env = self.env.clone();
|
||||||
let krate = krate.id;
|
let krate = krate.id;
|
||||||
|
|||||||
@@ -697,4 +697,26 @@ fn f() {
|
|||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn completes_method_call_when_receiver_type_has_errors_issue_10297() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
//- minicore: iterator, sized
|
||||||
|
struct Vec<T>;
|
||||||
|
impl<T> IntoIterator for Vec<T> {
|
||||||
|
type Item = ();
|
||||||
|
type IntoIter = ();
|
||||||
|
fn into_iter(self);
|
||||||
|
}
|
||||||
|
fn main() {
|
||||||
|
let x: Vec<_>;
|
||||||
|
x.$0;
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
expect![[r#"
|
||||||
|
me into_iter() (as IntoIterator) fn(self) -> <Self as IntoIterator>::IntoIter
|
||||||
|
"#]],
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user