Remove skip_norm_w/i/p().def_id with a helper#158620
Conversation
…nstantiate_identity().skip_norm_wip().def_id
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
| impl<I: Interner> EarlyBinder<I, ty::TraitRef<I>> { | ||
| pub fn def_id(&self) -> I::TraitId { | ||
| self.value.def_id | ||
| } | ||
| } |
There was a problem hiding this comment.
I added this only for EarlyBinder<TraitRef> because the only current skip_norm_wip().def_id
uses I found were for trait refs. I also did not find an existing trait for “contains a def_id”.
Should this stay narrow, or should I add a small trait so EarlyBinder<T> can expose def_id()
for any T that has one?
There was a problem hiding this comment.
hmm, this does seem like a somewhat useful abstraction, trait HasDefId and then wrappers just impl fn def_id for all T: HasDefId 🤔
I think for now that's probably not worth it, esp as in the trait solver we use different ids depending on what we're dealing with.
You can try doing that for EarlyBinder, Binder, and Unevaluated and see how it looks, but don't know whether it will end up being useful
There was a problem hiding this comment.
I will give it a shot locally and see how it looks, and let you know.
|
thanks @bors r+ rollup |
|
📋 Looks like this PR is still in progress, ignoring approval. Hint: Remove wip from this PR's title when it is ready for review. |
This seems new!! let me change the title |
|
@lcnr might need your approval again. |
|
@bors r+ rollup |
…nder-def-id, r=lcnr Remove skip_norm_w/i/p().def_id with a helper part of rust-lang#155345 r? @lcnr
…uwer Rollup of 5 pull requests Successful merges: - #158169 (Fix debuginfo compression in bootstrap) - #158613 (Fix getrandom fallback test on platforms with `panic=abort`) - #158620 (Remove skip_norm_w/i/p().def_id with a helper) - #158633 (Remove unnecessary `Clone` derives on resolver types) - #158634 (Add missing `needs_drop` check to `DroplessArena`.)
…nder-def-id, r=lcnr Remove skip_norm_w/i/p().def_id with a helper part of rust-lang#155345 r? @lcnr
…uwer Rollup of 8 pull requests Successful merges: - #150075 (Implement clamp_to) - #158169 (Fix debuginfo compression in bootstrap) - #158397 (delegation: support simplest output `Self` mapping) - #158613 (Fix getrandom fallback test on platforms with `panic=abort`) - #158620 (Remove skip_norm_w/i/p().def_id with a helper) - #158633 (Remove unnecessary `Clone` derives on resolver types) - #158634 (Add missing `needs_drop` check to `DroplessArena`.) - #158647 (Document `strip_circumfix` behavior on overlapping prefix and suffix.)
…nder-def-id, r=lcnr Remove skip_norm_w/i/p().def_id with a helper part of rust-lang#155345 r? @lcnr
…uwer Rollup of 8 pull requests Successful merges: - #150075 (Implement clamp_to) - #156716 (tests: fix: parallel frontend test failures: different alloc ids) - #158397 (delegation: support simplest output `Self` mapping) - #158613 (Fix getrandom fallback test on platforms with `panic=abort`) - #158620 (Remove skip_norm_w/i/p().def_id with a helper) - #158633 (Remove unnecessary `Clone` derives on resolver types) - #158634 (Add missing `needs_drop` check to `DroplessArena`.) - #158647 (Document `strip_circumfix` behavior on overlapping prefix and suffix.)
…uwer Rollup of 8 pull requests Successful merges: - #158294 (Use .drectve for MSVC DLL exports) - #156716 (tests: fix: parallel frontend test failures: different alloc ids) - #158397 (delegation: support simplest output `Self` mapping) - #158613 (Fix getrandom fallback test on platforms with `panic=abort`) - #158620 (Remove skip_norm_w/i/p().def_id with a helper) - #158633 (Remove unnecessary `Clone` derives on resolver types) - #158634 (Add missing `needs_drop` check to `DroplessArena`.) - #158647 (Document `strip_circumfix` behavior on overlapping prefix and suffix.)
part of #155345
r? @lcnr