Skip to content

Use special DefIds for aliases#155981

Open
ChayimFriedman2 wants to merge 1 commit intorust-lang:mainfrom
ChayimFriedman2:alias-def-id
Open

Use special DefIds for aliases#155981
ChayimFriedman2 wants to merge 1 commit intorust-lang:mainfrom
ChayimFriedman2:alias-def-id

Conversation

@ChayimFriedman2
Copy link
Copy Markdown
Contributor

@ChayimFriedman2 ChayimFriedman2 commented Apr 30, 2026

View all comments

Renewal of #155025, after AliasTermKind was also ported.

Like we do for other things for better experience in rust-analyzer.

It's possible now that the AliasTyKind and AliasTermKind contains the DefId.

It does require a few try_into().unwrap()s since in the solver's consider_X_candidate() only get an untyped DefId. It's possible to reduce that considerably if we'd pass them the typed def id as a parameter, but I don't know what will be the impact on perf. Should I try to pursue that?

r? lcnr

@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Apr 30, 2026
Comment thread compiler/rustc_next_trait_solver/src/solve/normalizes_to/inherent.rs Outdated
Comment thread compiler/rustc_next_trait_solver/src/solve/normalizes_to/mod.rs
Comment thread compiler/rustc_next_trait_solver/src/solve/normalizes_to/mod.rs
Comment thread compiler/rustc_type_ir/src/relate.rs
Comment thread compiler/rustc_next_trait_solver/src/delegate.rs Outdated
Like we do for other things for better experience in rust-analyzer.

It's possible now that the `AliasTyKind` and `AliasTermKind` contains the DefId.

It does require a few `try_into().unwrap()`s since in the solver's `consider_X_candidate()` only get an untyped `DefId`. It's possible to reduce that considerably if we'd pass them the typed def id as a parameter, but I don't know what will be the impact on perf.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 4, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@ChayimFriedman2
Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Copy Markdown
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 4, 2026

⌛ Trying commit 5e8cb76 with merge ce54c3a

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/25299606130

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 4, 2026
rust-bors Bot pushed a commit that referenced this pull request May 4, 2026
@ChayimFriedman2
Copy link
Copy Markdown
Contributor Author

@bors cancel

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 4, 2026

❗ There is currently no auto build in progress on this PR.

Hint: There is a pending try build on this PR. Maybe you meant to cancel it? You can do that using @bors try cancel.

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

Labels

S-waiting-on-perf Status: Waiting on a perf run to be completed. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants