Skip to content

rustc: Harmonize DefKind and DefPathData #118573

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

petrochenkov
Copy link
Contributor

Follow up to #118188.

DefPathData::(ClosureExpr,ImplTrait) are renamed to match DefKind::(Closure,OpaqueTy).

DefPathData::ImplTraitAssocTy is replaced with DefPathData::TypeNS(kw::Empty) because both correspond to DefKind::AssocTy.
It's possible that introducing (DefKind,DefPathData)::AssocOpaqueTy instead could be a better solution, but that would be a much more invasive change.

Const generic parameters introduced for effects are moved from DefPathData::TypeNS to DefPathData::ValueNS, because constants are values.

DefPathData is no longer passed to create_def functions to avoid redundancy.

`DefPathData::(ClosureExpr,ImplTrait)` are renamed to match `DefKind::(Closure,OpaqueTy)`.

`DefPathData::ImplTraitAssocTy` is replaced with `DefPathData::TypeNS(kw::Empty)` because both correspond to `DefKind::AssocTy`.
It's possible that introducing `(DefKind,DefPathData)::AssocOpaqueTy` could be a better solution, but that would be a much more invasive change.

Const generic parameters introduced for effects are moved from `DefPathData::TypeNS` to `DefPathData::ValueNS`, because constants are values.

`DefPathData` is no longer passed to `create_def` functions to avoid redundancy.
@rustbot
Copy link
Collaborator

rustbot commented Dec 3, 2023

r? @TaKO8Ki

(rustbot has picked a reviewer for you, use r? to override)

@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 Dec 3, 2023
@rustbot
Copy link
Collaborator

rustbot commented Dec 3, 2023

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

@TaKO8Ki
Copy link
Member

TaKO8Ki commented Dec 3, 2023

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 3, 2023

📌 Commit 17e799c has been approved by TaKO8Ki

It is now in the queue for this repository.

@bors bors 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 Dec 3, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 4, 2023
Rollup of 5 pull requests

Successful merges:

 - rust-lang#118495 (Restrict what symbols can be used in `#[diagnostic::on_unimplemented]` format strings)
 - rust-lang#118540 (codegen, miri: fix computing the offset of an unsized field in a packed struct)
 - rust-lang#118551 (more targeted errors when extern types end up in places they should not)
 - rust-lang#118573 (rustc: Harmonize `DefKind` and `DefPathData`)
 - rust-lang#118586 (Improve example in `slice::windows()` doc)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 30a4215 into rust-lang:master Dec 4, 2023
@rustbot rustbot added this to the 1.76.0 milestone Dec 4, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 4, 2023
Rollup merge of rust-lang#118573 - petrochenkov:pathdatakind, r=TaKO8Ki

rustc: Harmonize `DefKind` and `DefPathData`

Follow up to rust-lang#118188.

`DefPathData::(ClosureExpr,ImplTrait)` are renamed to match `DefKind::(Closure,OpaqueTy)`.

`DefPathData::ImplTraitAssocTy` is replaced with `DefPathData::TypeNS(kw::Empty)` because both correspond to `DefKind::AssocTy`.
It's possible that introducing `(DefKind,DefPathData)::AssocOpaqueTy` instead could be a better solution, but that would be a much more invasive change.

Const generic parameters introduced for effects are moved from `DefPathData::TypeNS` to `DefPathData::ValueNS`, because constants are values.

`DefPathData` is no longer passed to `create_def` functions to avoid redundancy.
@petrochenkov petrochenkov deleted the pathdatakind branch February 22, 2025 18:29
# for free to join this conversation on GitHub. Already have an account? # 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