1
Fork 0

Rollup merge of #118573 - petrochenkov:pathdatakind, r=TaKO8Ki

rustc: Harmonize `DefKind` and `DefPathData`

Follow up to https://github.com/rust-lang/rust/pull/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.
This commit is contained in:
Takayuki Maeda 2023-12-04 21:19:45 +09:00 committed by GitHub
commit 30a4215532
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 133 additions and 132 deletions

View file

@ -594,7 +594,7 @@ fn push_unqualified_item_name(
DefPathData::CrateRoot => {
output.push_str(tcx.crate_name(def_id.krate).as_str());
}
DefPathData::ClosureExpr => {
DefPathData::Closure => {
let label = coroutine_kind_label(tcx.coroutine_kind(def_id));
push_disambiguated_special_name(