summaryrefslogtreecommitdiffstats
path: root/src/librustdoc/json
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:11:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:13:23 +0000
commit20431706a863f92cb37dc512fef6e48d192aaf2c (patch)
tree2867f13f5fd5437ba628c67d7f87309ccadcd286 /src/librustdoc/json
parentReleasing progress-linux version 1.65.0+dfsg1-2~progress7.99u1. (diff)
downloadrustc-20431706a863f92cb37dc512fef6e48d192aaf2c.tar.xz
rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.zip
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/librustdoc/json')
-rw-r--r--src/librustdoc/json/conversions.rs12
-rw-r--r--src/librustdoc/json/mod.rs8
2 files changed, 14 insertions, 6 deletions
diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs
index 49a31f5f1..cdf59cdd3 100644
--- a/src/librustdoc/json/conversions.rs
+++ b/src/librustdoc/json/conversions.rs
@@ -272,7 +272,12 @@ fn from_clean_item(item: clean::Item, tcx: TyCtxt<'_>) -> ItemEnum {
ConstantItem(c) => ItemEnum::Constant(c.into_tcx(tcx)),
MacroItem(m) => ItemEnum::Macro(m.source),
ProcMacroItem(m) => ItemEnum::ProcMacro(m.into_tcx(tcx)),
- PrimitiveItem(p) => ItemEnum::PrimitiveType(p.as_sym().to_string()),
+ PrimitiveItem(p) => {
+ ItemEnum::Primitive(Primitive {
+ name: p.as_sym().to_string(),
+ impls: Vec::new(), // Added in JsonRenderer::item
+ })
+ }
TyAssocConstItem(ty) => ItemEnum::AssocConst { type_: ty.into_tcx(tcx), default: None },
AssocConstItem(ty, default) => {
ItemEnum::AssocConst { type_: ty.into_tcx(tcx), default: Some(default.expr(tcx)) }
@@ -427,8 +432,9 @@ impl FromWithTcx<clean::WherePredicate> for WherePredicate {
lifetime: convert_lifetime(lifetime),
bounds: bounds.into_tcx(tcx),
},
- EqPredicate { lhs, rhs } => {
- WherePredicate::EqPredicate { lhs: lhs.into_tcx(tcx), rhs: rhs.into_tcx(tcx) }
+ // FIXME(fmease): Convert bound parameters as well.
+ EqPredicate { lhs, rhs, bound_params: _ } => {
+ WherePredicate::EqPredicate { lhs: (*lhs).into_tcx(tcx), rhs: (*rhs).into_tcx(tcx) }
}
}
}
diff --git a/src/librustdoc/json/mod.rs b/src/librustdoc/json/mod.rs
index 5e8f5f6fe..d13efe6c1 100644
--- a/src/librustdoc/json/mod.rs
+++ b/src/librustdoc/json/mod.rs
@@ -108,7 +108,6 @@ impl<'tcx> JsonRenderer<'tcx> {
.filter_map(|(&id, trait_item)| {
// only need to synthesize items for external traits
if !id.is_local() {
- let trait_item = &trait_item.trait_;
for item in &trait_item.items {
trace!("Adding subitem to {id:?}: {:?}", item.item_id);
self.item(item.clone()).unwrap();
@@ -219,12 +218,15 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
u.impls = self.get_impls(item_id.expect_def_id());
false
}
+ types::ItemEnum::Primitive(ref mut p) => {
+ p.impls = self.get_impls(item_id.expect_def_id());
+ false
+ }
types::ItemEnum::Method(_)
| types::ItemEnum::Module(_)
| types::ItemEnum::AssocConst { .. }
- | types::ItemEnum::AssocType { .. }
- | types::ItemEnum::PrimitiveType(_) => true,
+ | types::ItemEnum::AssocType { .. } => true,
types::ItemEnum::ExternCrate { .. }
| types::ItemEnum::Import(_)
| types::ItemEnum::StructField(_)