about summary refs log tree commit diff
path: root/src/librustdoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-19 21:23:39 +0000
committerbors <bors@rust-lang.org>2023-09-19 21:23:39 +0000
commitbdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a (patch)
treece02ec8d67d4529a511da42385a14ea2bd36e409 /src/librustdoc
parentac5ac4754a4a837f7138a1fa5ab01475b63fc9fe (diff)
parent832a2a18e722f13141898a7c3918c5cb45a8c043 (diff)
downloadrust-bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a.tar.gz
rust-bdb0fa3ee5ffb4cc1a1b53cbe8344a2b83b1ae2a.zip
Auto merge of #113955 - cjgillot:name-apit, r=WaffleLapkin
Pretty-print argument-position impl trait to name it.

This removes a corner case.

RPIT and TAIT keep having no name, and it would be wrong to use the one in HIR (Ident::empty), so I make this case ICE.
Diffstat (limited to 'src/librustdoc')
-rw-r--r--src/librustdoc/clean/utils.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs
index 8cddd5f9a87..e680b451421 100644
--- a/src/librustdoc/clean/utils.rs
+++ b/src/librustdoc/clean/utils.rs
@@ -153,7 +153,7 @@ pub(super) fn external_path<'tcx>(
     args: ty::Binder<'tcx, GenericArgsRef<'tcx>>,
 ) -> Path {
     let def_kind = cx.tcx.def_kind(did);
-    let name = cx.tcx.item_name(did);
+    let name = cx.tcx.opt_item_name(did).unwrap_or(kw::Empty);
     Path {
         res: Res::Def(def_kind, did),
         segments: thin_vec![PathSegment {