-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix regressed test due to rust-lang/rust#78461 #1144
Conversation
One concrete example is when we have a partially resolved generic type which calls a `Self`-returning method, e.g. `Vec<String, _>::new()`. Previously, the returned type for `Self`-returning methods would return the unresolved, generic type as encountered in the impl header (so `Vec<T, A: AllocRef = Global>` in this case). However, if the method match already carries some information about generics (T := String here), make sure to account for it.
src/racer/ast.rs
Outdated
if let (Some(Ty::Match(ref mut m)), Some(gen)) = (&mut return_ty, gen) { | ||
let resolved = gen.args().filter_map(|tp| tp.resolved()); | ||
for (l, r) in m.generics_mut().zip(resolved) { | ||
l.resolve(r.clone()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a hack but I encountered a similar resolve/substitution code in other places, so it seems it's not as out of place as it looks at a first glance.
There may be other designs how to tackle this but decided for it because it's least invasive for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Otherwise we may have an order mismatch Co-authored-by: Yuji Kanagawa <yuji.kngw.80s.revive@gmail.com>
78d89ff
to
a67ca96
Compare
Squashed the last few fixup commits and force-pushed |
Going to merge the final version since it's approved. Thanks for taking a look! |
Thanks! |
See #1143 for more context.