Skip to content

Commit a67ca96

Browse files
Xanewokkngwyu
andcommitted
Don't filter out possible unresolved type params
Otherwise we may have an order mismatch Co-authored-by: Yuji Kanagawa <yuji.kngw.80s.revive@gmail.com>
1 parent e344dd1 commit a67ca96

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/racer/ast.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,10 @@ impl<'c, 's, 'ast> visit::Visitor<'ast> for ExprTypeVisitor<'c, 's> {
531531
// Account for already resolved generics if the return type is Self
532532
// (in which case we return bare type as found in the `impl` header)
533533
if let (Some(Ty::Match(ref mut m)), Some(gen)) = (&mut return_ty, gen) {
534-
let resolved = gen.args().filter_map(|tp| tp.resolved());
535-
for (l, r) in m.generics_mut().zip(resolved) {
536-
l.resolve(r.clone());
534+
for (type_param, arg) in m.generics_mut().zip(gen.args()) {
535+
if let Some(resolved) = arg.resolved() {
536+
type_param.resolve(resolved.clone());
537+
}
537538
}
538539
}
539540
return_ty.and_then(

0 commit comments

Comments
 (0)