Cleanup substitutions and treatment of generics around traits in a number of ways #5802
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.
Cleanup substitutions and treatment of generics around traits in a number of ways
impl Trait<A,B,C> for S
has a self type ofS
.A:Trait
has the self typeA
Self
Self
@Trait
has no self typeeach_bound_traits_and_supertraits
to performsubstitutions as it goes, and thus yield a series of trait refs
that are always in the same 'namespace' as the type parameter
bound given as input. Before, we left this to the caller, but
this doesn't work because the caller lacks adequare information
to perform the type substitutions correctly.
method correctly.
parameter and brings them together with the def_id and (in the future)
other information (maybe even the parameter's name!).
repetitive code involved with doing type substitution.
Fixes #4183. Needed for #5656.
r? @catamorphism