diff options
| author | Cameron Steffen <cam.steffen94@gmail.com> | 2025-08-13 15:24:19 -0500 |
|---|---|---|
| committer | Cameron Steffen <cam.steffen94@gmail.com> | 2025-09-12 15:14:15 -0500 |
| commit | 9615ec7d108399501d7d48f4aeac46561ef31fc8 (patch) | |
| tree | a06cb4dbb6550440a2aacf3f4d7d89e618172e5c /src/librustdoc/clean/mod.rs | |
| parent | 88a8bfcaf0398011b621a981483c288d1e3b64e2 (diff) | |
| download | rust-9615ec7d108399501d7d48f4aeac46561ef31fc8.tar.gz rust-9615ec7d108399501d7d48f4aeac46561ef31fc8.zip | |
Split AssocContainer::{InherentImpl,TraitImpl}
Diffstat (limited to 'src/librustdoc/clean/mod.rs')
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index b98f174fbbf..8c40e42562c 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1295,11 +1295,13 @@ pub(crate) fn clean_middle_assoc_item(assoc_item: &ty::AssocItem, cx: &mut DocCo simplify::move_bounds_to_generic_parameters(&mut generics); match assoc_item.container { - ty::AssocContainer::Impl => ImplAssocConstItem(Box::new(Constant { - generics, - kind: ConstantKind::Extern { def_id: assoc_item.def_id }, - type_: ty, - })), + ty::AssocContainer::InherentImpl | ty::AssocContainer::TraitImpl(_) => { + ImplAssocConstItem(Box::new(Constant { + generics, + kind: ConstantKind::Extern { def_id: assoc_item.def_id }, + type_: ty, + })) + } ty::AssocContainer::Trait => { if tcx.defaultness(assoc_item.def_id).has_value() { ProvidedAssocConstItem(Box::new(Constant { @@ -1318,7 +1320,7 @@ pub(crate) fn clean_middle_assoc_item(assoc_item: &ty::AssocItem, cx: &mut DocCo if has_self { let self_ty = match assoc_item.container { - ty::AssocContainer::Impl => { + ty::AssocContainer::InherentImpl | ty::AssocContainer::TraitImpl(_) => { tcx.type_of(assoc_item.container_id(tcx)).instantiate_identity() } ty::AssocContainer::Trait => tcx.types.self_param, @@ -1338,13 +1340,13 @@ pub(crate) fn clean_middle_assoc_item(assoc_item: &ty::AssocItem, cx: &mut DocCo } let provided = match assoc_item.container { - ty::AssocContainer::Impl => true, + ty::AssocContainer::InherentImpl | ty::AssocContainer::TraitImpl(_) => true, ty::AssocContainer::Trait => assoc_item.defaultness(tcx).has_value(), }; if provided { let defaultness = match assoc_item.container { - ty::AssocContainer::Impl => Some(assoc_item.defaultness(tcx)), - ty::AssocContainer::Trait => None, + ty::AssocContainer::TraitImpl(_) => Some(assoc_item.defaultness(tcx)), + ty::AssocContainer::InherentImpl | ty::AssocContainer::Trait => None, }; MethodItem(item, defaultness) } else { |
