mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-28 14:03:35 +00:00
4385d3dcd0
This commit "inverts" the order of generic parameters/arguments of an item and its parent. This is to fulfill chalk's expectation on the order of `Substitution` for generic associated types and it's one step forward for their support (hopefully). Although chalk doesn't put any constraint on the order of `Substitution` for other items, it feels natural to get everything aligned rather than special casing GATs. One complication is that `TyBuilder` now demands its users to pass in parent's `Substitution` upon construction unless it's obvious that the the item has no parent (e.g. an ADT never has parent). All users *should* already know the parent of the item in question, and without this, it cannot be easily reasoned about whether we're pushing the argument for the item or for its parent. Quick comparison of how this commit changes `Substitution`: ```rust trait Trait<TP, const CP: usize> { type Type<TC, const CC: usize> = (); fn f<TC, const CC: usize>() {} } ``` - before this commit: `[Self, TP, CP, TC, CC]` for each trait item - after this commit: `[TC, CC, Self, TP, CP]` for each trait item |
||
---|---|---|
.. | ||
base-db | ||
cfg | ||
flycheck | ||
hir | ||
hir-def | ||
hir-expand | ||
hir-ty | ||
ide | ||
ide-assists | ||
ide-completion | ||
ide-db | ||
ide-diagnostics | ||
ide-ssr | ||
limit | ||
mbe | ||
parser | ||
paths | ||
proc-macro-api | ||
proc-macro-srv | ||
proc-macro-srv-cli | ||
proc-macro-test | ||
profile | ||
project-model | ||
rust-analyzer | ||
sourcegen | ||
stdx | ||
syntax | ||
test-utils | ||
text-edit | ||
toolchain | ||
tt | ||
vfs | ||
vfs-notify |