]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/clean/inline.rs
Auto merge of #85363 - EFanZh:gdb-pretty-print-slices, r=michaelwoerister
[rust.git] / src / librustdoc / clean / inline.rs
index 7b1b23ff8e6d37ad0aea986455e395b196e31b58..175c7facfdbeb7c89430ba66504c8239fcb6c307 100644 (file)
@@ -15,7 +15,7 @@
 use rustc_span::symbol::{kw, sym, Symbol};
 
 use crate::clean::{
-    self, utils, Attributes, AttributesExt, FakeDefId, GetDefId, NestedAttributesExt, Type,
+    self, utils, Attributes, AttributesExt, GetDefId, ItemId, NestedAttributesExt, Type,
 };
 use crate::core::DocContext;
 use crate::formats::item_type::ItemType;
@@ -483,10 +483,11 @@ fn build_module(
             }
             if let Res::PrimTy(p) = item.res {
                 // Primitive types can't be inlined so generate an import instead.
+                let prim_ty = clean::PrimitiveType::from(p);
                 items.push(clean::Item {
                     name: None,
                     attrs: box clean::Attributes::default(),
-                    def_id: FakeDefId::new_fake(did.krate),
+                    def_id: ItemId::Primitive(prim_ty, did.krate),
                     visibility: clean::Public,
                     kind: box clean::ImportItem(clean::Import::new_simple(
                         item.ident.name,
@@ -495,7 +496,7 @@ fn build_module(
                                 global: false,
                                 res: item.res,
                                 segments: vec![clean::PathSegment {
-                                    name: clean::PrimitiveType::from(p).as_sym(),
+                                    name: prim_ty.as_sym(),
                                     args: clean::GenericArgs::AngleBracketed {
                                         args: Vec::new(),
                                         bindings: Vec::new(),
@@ -552,7 +553,7 @@ fn build_macro(cx: &mut DocContext<'_>, did: DefId, name: Symbol) -> clean::Item
 
                 let source = format!(
                     "macro_rules! {} {{\n{}}}",
-                    name.clean(cx),
+                    name,
                     utils::render_macro_arms(matchers, ";")
                 );