File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed
ide_completion/src/completions Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -2601,9 +2601,7 @@ impl Type {
2601
2601
) {
2602
2602
// There should be no inference vars in types passed here
2603
2603
// FIXME check that?
2604
- // FIXME replace Unknown by bound vars here
2605
- let canonical =
2606
- Canonical { value : self . ty . clone ( ) , binders : CanonicalVarKinds :: empty ( & Interner ) } ;
2604
+ let canonical = hir_ty:: replace_errors_with_variables ( & self . ty ) ;
2607
2605
2608
2606
let env = self . env . clone ( ) ;
2609
2607
let krate = krate. id ;
Original file line number Diff line number Diff line change @@ -697,4 +697,26 @@ fn f() {
697
697
"# ] ] ,
698
698
) ;
699
699
}
700
+
701
+ #[ test]
702
+ fn completes_method_call_when_receiver_type_has_errors_issue_10297 ( ) {
703
+ check (
704
+ r#"
705
+ //- minicore: iterator, sized
706
+ struct Vec<T>;
707
+ impl<T> IntoIterator for Vec<T> {
708
+ type Item = ();
709
+ type IntoIter = ();
710
+ fn into_iter(self);
711
+ }
712
+ fn main() {
713
+ let x: Vec<_>;
714
+ x.$0;
715
+ }
716
+ "# ,
717
+ expect ! [ [ r#"
718
+ me into_iter() (as IntoIterator) fn(self) -> <Self as IntoIterator>::IntoIter
719
+ "# ] ] ,
720
+ )
721
+ }
700
722
}
You can’t perform that action at this time.
0 commit comments