traits: Represent live alias arguments as bitsets - #160936
Conversation
Store identity argument indices instead of bound generic arguments so callers can index concrete alias arguments without changing rigidness through instantiation.
|
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@lcnr hey, this is the bitset-only split from #160212 / the Zulip thread: https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/rigid.20aliases.20in.20region.20handling/near/615557841 fyi no matcher / ICE changes here. just arg indices via imo this is the boring half and should be easy to land first. the interesting open question (proper matching vs underapproximating in |
|
@bors try @rust-timer queue I assume we want to test perf on this, this seems like it could have perf implications. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
traits: Represent live alias arguments as bitsets
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (eb7fea4): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (secondary 2.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -0.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 455.693s -> 454.48s (-0.27%) |
|
Would it be better to use an index newtype since it's on public API? Unsure it matters much since it's actually only used in the same module. |
either seems fine to me personally 🤷 |
Match the existing params_in_repr / unsizing_params convention; the compiler already treats generic arg counts as u32-sized.
Split out of #160212 per review / Zulip: https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/rigid.20aliases.20in.20region.20handling/near/615557841
live_args_for_alias_from_outlives_boundsandargs_known_to_outlive_alias_paramsnow return identity arg indices (DenseBitSet) instead ofEarlyBinder<GenericArg>. Callers just doargs[idx].visit_with(...), so we stop laundering rigidness through binder instantiate. Also drops the old BitSet FIXME.imo this is worth doing on its own even without the ICE fix. every time we shoved identity params through
EarlyBinderwe were writing down something we don't actually know, and this module is only going to grow. better to make the invariant explicit now than keep paying for it later.No behavioral change intended. the rigid-alias ICE /
extract_verify_if_eqbits stay on #160212. btw if that one should stack on this instead of staying independent, lmk and I'll rebase it asap.