diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-04-11 14:32:00 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-04-11 19:08:14 +1000 |
| commit | 9eca59a94021089905c482011a2d88ee9b862a73 (patch) | |
| tree | e8b788e412fb4fb8575ce9824ffd76da37772e73 /compiler/rustc_ty_utils/src | |
| parent | fad2535e4b49f95becb8f2e3166795cbf408ec73 (diff) | |
| download | rust-9eca59a94021089905c482011a2d88ee9b862a73.tar.gz rust-9eca59a94021089905c482011a2d88ee9b862a73.zip | |
Introduce `DefPathData::AnonAssocTy`.
PR #137977 changed `DefPathData::TypeNs` to contain `Option<Symbol>` to account for RPITIT assoc types being anonymous. This commit changes it back to `Symbol` and gives anonymous assoc types their own variant. It makes things a bit nicer overall.
Diffstat (limited to 'compiler/rustc_ty_utils/src')
| -rw-r--r-- | compiler/rustc_ty_utils/src/assoc.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ty_utils/src/assoc.rs b/compiler/rustc_ty_utils/src/assoc.rs index b7684e85d41..9520d948f51 100644 --- a/compiler/rustc_ty_utils/src/assoc.rs +++ b/compiler/rustc_ty_utils/src/assoc.rs @@ -252,7 +252,7 @@ fn associated_type_for_impl_trait_in_trait( assert_eq!(tcx.def_kind(trait_def_id), DefKind::Trait); let span = tcx.def_span(opaque_ty_def_id); - // No name because this is a synthetic associated type. + // No name because this is an anonymous associated type. let trait_assoc_ty = tcx.at(span).create_def(trait_def_id, None, DefKind::AssocTy); let local_def_id = trait_assoc_ty.def_id(); @@ -305,7 +305,7 @@ fn associated_type_for_impl_trait_in_impl( hir::FnRetTy::DefaultReturn(_) => tcx.def_span(impl_fn_def_id), hir::FnRetTy::Return(ty) => ty.span, }; - // No name because this is a synthetic associated type. + // No name because this is an anonymous associated type. let impl_assoc_ty = tcx.at(span).create_def(impl_local_def_id, None, DefKind::AssocTy); let local_def_id = impl_assoc_ty.def_id(); |
