Skip to content

remove calls to AliasTyKind::def_id#155356

Open
WilliamTakeshi wants to merge 1 commit intorust-lang:mainfrom
WilliamTakeshi:remove_calls_to_def_id
Open

remove calls to AliasTyKind::def_id#155356
WilliamTakeshi wants to merge 1 commit intorust-lang:mainfrom
WilliamTakeshi:remove_calls_to_def_id

Conversation

@WilliamTakeshi
Copy link
Copy Markdown
Contributor

ref #154941

I asked the LSP where AliasTyKind::def_id and then checked where the AliasTyKind::def_id was trivial to change. Could only find 2 places, and I am not sure about the opaque_types.rs (open to feedback!! :) ). All the others need refactoring or will end up with a logic as complex as AliasTyKind::def_id

This is the list checked:

  • compiler/rustc_borrowck/src/region_infer/opaque_types/member_constraints.rs — 1
  • compiler/rustc_borrowck/src/region_infer/opaque_types/mod.rs — 1
  • compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs — 5
  • compiler/rustc_hir_analysis/src/check/mod.rs — 1
  • compiler/rustc_infer/src/infer/outlives/for_liveness.rs — 2
  • compiler/rustc_infer/src/infer/outlives/obligations.rs — 1
  • compiler/rustc_infer/src/infer/outlives/verify.rs — 3
  • compiler/rustc_middle/src/ty/print/pretty.rs — 1
  • compiler/rustc_middle/src/ty/sty.rs — 1
  • compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs — 3
  • compiler/rustc_next_trait_solver/src/solve/effect_goals.rs — 3
  • compiler/rustc_pattern_analysis/src/rustc.rs — 1
  • compiler/rustc_public/src/unstable/convert/stable/ty.rs — 1
  • compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs — 2
  • compiler/rustc_trait_selection/src/error_reporting/infer/note_and_explain.rs — 4
  • compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs — 2
  • compiler/rustc_trait_selection/src/traits/effects.rs — 1
  • compiler/rustc_trait_selection/src/traits/query/normalize.rs — 1
  • compiler/rustc_ty_utils/src/opaque_types.rs — 7
  • compiler/rustc_ty_utils/src/ty.rs — 1
  • compiler/rustc_type_ir/src/outlives.rs — 1
  • compiler/rustc_type_ir/src/predicate.rs — 1
  • compiler/rustc_type_ir/src/relate.rs — 5
  • compiler/rustc_type_ir/src/ty_kind.rs — 2

r? @WaffleLapkin

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 15, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 15, 2026

WaffleLapkin is not on the review rotation at the moment.
They may take a while to respond.

Copy link
Copy Markdown
Member

@WaffleLapkin WaffleLapkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we'd refactor all of the other cases as well, but this is a small improvement so looks good to me :)

View changes since this review

@WaffleLapkin
Copy link
Copy Markdown
Member

r=me with green CI
@bors delegate

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 15, 2026

✌️ @WilliamTakeshi, you can now approve this pull request!

If @WaffleLapkin told you to "r=me" after making some further change, then please make that change and post @bors r=WaffleLapkin.

@Kivooeo
Copy link
Copy Markdown
Member

Kivooeo commented Apr 15, 2026

@bors r=WaffleLapkin rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 15, 2026

📌 Commit dbb83b6 has been approved by WaffleLapkin

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 15, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 16, 2026
…_id, r=WaffleLapkin

remove calls to AliasTyKind::def_id

ref rust-lang#154941

I asked the LSP where `AliasTyKind::def_id` and then checked where the `AliasTyKind::def_id` was trivial to change. Could only find 2 places, and I am not sure about the `opaque_types.rs` (open to feedback!! :) ). All the others need refactoring or will end up with a logic as complex as `AliasTyKind::def_id`

This is the list checked:
- [X] compiler/rustc_borrowck/src/region_infer/opaque_types/member_constraints.rs — 1
- [X] compiler/rustc_borrowck/src/region_infer/opaque_types/mod.rs — 1
- [X] compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs — 5
- [X] compiler/rustc_hir_analysis/src/check/mod.rs — 1
- [X] compiler/rustc_infer/src/infer/outlives/for_liveness.rs — 2
- [X] compiler/rustc_infer/src/infer/outlives/obligations.rs — 1
- [X] compiler/rustc_infer/src/infer/outlives/verify.rs — 3
- [X] compiler/rustc_middle/src/ty/print/pretty.rs — 1
- [X] compiler/rustc_middle/src/ty/sty.rs — 1
- [X] compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs — 3
- [X] compiler/rustc_next_trait_solver/src/solve/effect_goals.rs — 3
- [X] compiler/rustc_pattern_analysis/src/rustc.rs — 1
- [X] compiler/rustc_public/src/unstable/convert/stable/ty.rs — 1
- [X] compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs — 2
- [X] compiler/rustc_trait_selection/src/error_reporting/infer/note_and_explain.rs — 4
- [X] compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs — 2
- [X] compiler/rustc_trait_selection/src/traits/effects.rs — 1
- [X] compiler/rustc_trait_selection/src/traits/query/normalize.rs — 1
- [X] compiler/rustc_ty_utils/src/opaque_types.rs — 7
- [X] compiler/rustc_ty_utils/src/ty.rs — 1
- [X] compiler/rustc_type_ir/src/outlives.rs — 1
- [X] compiler/rustc_type_ir/src/predicate.rs — 1
- [X] compiler/rustc_type_ir/src/relate.rs — 5
- [X] compiler/rustc_type_ir/src/ty_kind.rs — 2

r? @WaffleLapkin
rust-bors bot pushed a commit that referenced this pull request Apr 16, 2026
Rollup of 18 pull requests

Successful merges:

 - #154595 (Emit fatal on invalid const args with nested defs)
 - #154599 (report the `varargs_without_pattern` lint in deps)
 - #154699 (`core::unicode`: Replace `Cased` table with `Lt`)
 - #155353 (resolve: Remove `inaccessible_ctor_reexport` resolver field)
 - #155357 (Add `--remap-path-scope` as unstable in rustdoc)
 - #150649 (clippy fix: non_canonical_clone_impl)
 - #154604 (abort in core)
 - #154616 (Add `--quiet` flag to x.py and bootstrap to suppress output)
 - #154970 (rustdoc: preserve `doc(cfg)` on locally re-exported type aliases)
 - #155215 (Clean up `AttributeLintKind` and refactor diagnostic attribute linting)
 - #155228 (Check diagnostic output in incremental `cpass` and `rpass` revisions)
 - #155266 (Adjust release notes for post-merge feedback)
 - #155326 (Disallow ZST allocations with `TypedArena`.)
 - #155334 (docs: Use `0b1` instead of `NonZero::MIN` in `NonZero::bit_width` doctests)
 - #155340 (Handle nonnull pattern types in size skeleton)
 - #155347 (Add push_mut and new Layout methods to release notes)
 - #155356 (remove calls to AliasTyKind::def_id)
 - #155364 (Reduce diagnostic type visibilities.)
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 16, 2026
…_id, r=WaffleLapkin

remove calls to AliasTyKind::def_id

ref rust-lang#154941

I asked the LSP where `AliasTyKind::def_id` and then checked where the `AliasTyKind::def_id` was trivial to change. Could only find 2 places, and I am not sure about the `opaque_types.rs` (open to feedback!! :) ). All the others need refactoring or will end up with a logic as complex as `AliasTyKind::def_id`

This is the list checked:
- [X] compiler/rustc_borrowck/src/region_infer/opaque_types/member_constraints.rs — 1
- [X] compiler/rustc_borrowck/src/region_infer/opaque_types/mod.rs — 1
- [X] compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs — 5
- [X] compiler/rustc_hir_analysis/src/check/mod.rs — 1
- [X] compiler/rustc_infer/src/infer/outlives/for_liveness.rs — 2
- [X] compiler/rustc_infer/src/infer/outlives/obligations.rs — 1
- [X] compiler/rustc_infer/src/infer/outlives/verify.rs — 3
- [X] compiler/rustc_middle/src/ty/print/pretty.rs — 1
- [X] compiler/rustc_middle/src/ty/sty.rs — 1
- [X] compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs — 3
- [X] compiler/rustc_next_trait_solver/src/solve/effect_goals.rs — 3
- [X] compiler/rustc_pattern_analysis/src/rustc.rs — 1
- [X] compiler/rustc_public/src/unstable/convert/stable/ty.rs — 1
- [X] compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs — 2
- [X] compiler/rustc_trait_selection/src/error_reporting/infer/note_and_explain.rs — 4
- [X] compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs — 2
- [X] compiler/rustc_trait_selection/src/traits/effects.rs — 1
- [X] compiler/rustc_trait_selection/src/traits/query/normalize.rs — 1
- [X] compiler/rustc_ty_utils/src/opaque_types.rs — 7
- [X] compiler/rustc_ty_utils/src/ty.rs — 1
- [X] compiler/rustc_type_ir/src/outlives.rs — 1
- [X] compiler/rustc_type_ir/src/predicate.rs — 1
- [X] compiler/rustc_type_ir/src/relate.rs — 5
- [X] compiler/rustc_type_ir/src/ty_kind.rs — 2

r? @WaffleLapkin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants