Fix regressed test due to rust-lang/rust#78461#1144
Merged
Xanewok merged 3 commits intoracer-rust:masterfrom Dec 2, 2020
Merged
Fix regressed test due to rust-lang/rust#78461#1144Xanewok merged 3 commits intoracer-rust:masterfrom
Xanewok merged 3 commits intoracer-rust:masterfrom
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.
Xanewok
commented
Dec 1, 2020
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()); |
Collaborator
Author
There was a problem hiding this comment.
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.
Otherwise we may have an order mismatch Co-authored-by: Yuji Kanagawa <yuji.kngw.80s.revive@gmail.com>
78d89ff to
a67ca96
Compare
Collaborator
Author
|
Squashed the last few fixup commits and force-pushed |
Merged
Collaborator
Author
|
Going to merge the final version since it's approved. Thanks for taking a look! |
Collaborator
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #1143 for more context.