}
}
}
- return prim.map(|p| (def_id, p, attrs));
+ return prim.map(|p| (def_id, p));
}
None
};
hir::ItemKind::Use(ref path, hir::UseKind::Single)
if item.vis.node.is_pub() =>
{
- as_primitive(path.res).map(|(_, prim, attrs)| {
+ as_primitive(path.res).map(|(_, prim)| {
// Pretend the primitive is local.
- (cx.tcx.hir().local_def_id(id.id).to_def_id(), prim, attrs)
+ (cx.tcx.hir().local_def_id(id.id).to_def_id(), prim)
})
}
_ => None,
}
}
}
- return keyword.map(|p| (def_id, p, attrs));
+ return keyword.map(|p| (def_id, p));
}
None
};
hir::ItemKind::Use(ref path, hir::UseKind::Single)
if item.vis.node.is_pub() =>
{
- as_keyword(path.res).map(|(_, prim, attrs)| {
- (cx.tcx.hir().local_def_id(id.id).to_def_id(), prim, attrs)
+ as_keyword(path.res).map(|(_, prim)| {
+ (cx.tcx.hir().local_def_id(id.id).to_def_id(), prim)
})
}
_ => None,
AssocTypeItem(bounds.clean(cx), default.clean(cx))
}
};
- Item::from_def_id_and_parts(local_did, Some(self.ident.name), inner, cx)
+ Item::from_def_id_and_parts(local_did, Some(self.ident.name.clean(cx)), inner, cx)
})
}
}
TypedefItem(Typedef { type_, generics: Generics::default(), item_type }, true)
}
};
- Item::from_def_id_and_parts(local_did, Some(self.ident.name), inner, cx)
+ Item::from_def_id_and_parts(local_did, Some(self.ident.name.clean(cx)), inner, cx)
})
}
}
}
};
- Item::from_def_id_and_parts(self.def_id, Some(self.ident.name), kind, cx)
+ Item::from_def_id_and_parts(self.def_id, Some(self.ident.name.clean(cx)), kind, cx)
}
}
}
/// Returns `None` if the type could not be normalized
+ #[allow(unreachable_code, unused_variables)]
fn normalize(cx: &DocContext<'tcx>, ty: Ty<'_>) -> Option<Ty<'tcx>> {
+ return None; // HACK: low-churn fix for #79459 while we wait for a trait normalization fix
use crate::rustc_trait_selection::infer::TyCtxtInferExt;
use crate::rustc_trait_selection::traits::query::normalize::AtExt;
use rustc_middle::traits::ObligationCause;
fn clean(&self, cx: &DocContext<'_>) -> Item {
let what_rustc_thinks = Item::from_def_id_and_parts(
self.did,
- Some(self.ident.name),
+ Some(self.ident.name.clean(cx)),
StructFieldItem(cx.tcx.type_of(self.did).clean(cx)),
cx,
);
fields: self
.fields
.iter()
- .map(|field| Item {
- source: cx.tcx.def_span(field.did).clean(cx),
- name: Some(field.ident.name.clean(cx)),
- attrs: cx.tcx.get_attrs(field.did).clean(cx),
- visibility: Visibility::Inherited,
- def_id: field.did,
- stability: get_stability(cx, field.did),
- deprecation: get_deprecation(cx, field.did),
- kind: StructFieldItem(cx.tcx.type_of(field.did).clean(cx)),
+ .map(|field| {
+ let name = Some(field.ident.name.clean(cx));
+ let kind = StructFieldItem(cx.tcx.type_of(field.did).clean(cx));
+ let what_rustc_thinks =
+ Item::from_def_id_and_parts(field.did, name, kind, cx);
+ // don't show `pub` for fields, which are always public
+ Item { visibility: Visibility::Inherited, ..what_rustc_thinks }
})
.collect(),
}),
};
let what_rustc_thinks = Item::from_def_id_and_parts(
self.def_id,
- Some(self.ident.name),
+ Some(self.ident.name.clean(cx)),
VariantItem(Variant { kind }),
cx,
);
_ => unreachable!("not yet converted"),
};
- vec![Item::from_def_id_and_parts(def_id, Some(name), kind, cx)]
+ vec![Item::from_def_id_and_parts(def_id, Some(name.clean(cx)), kind, cx)]
})
}
}
fn clean(&self, cx: &DocContext<'_>) -> Item {
Item::from_def_id_and_parts(
self.def_id,
- Some(self.name),
+ Some(self.name.clean(cx)),
MacroItem(Macro {
source: format!(
"macro_rules! {} {{\n{}}}",