1
Fork 0

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.
This commit is contained in:
bors 2023-09-19 21:23:39 +00:00
commit bdb0fa3ee5
4 changed files with 9 additions and 12 deletions

View file

@ -1431,12 +1431,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
),
ImplTraitContext::Universal => {
let span = t.span;
self.create_def(
self.current_hir_id_owner.def_id,
*def_node_id,
DefPathData::ImplTrait,
span,
);
// HACK: pprust breaks strings with newlines when the type
// gets too long. We don't want these to show up in compiler
@ -1447,6 +1441,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
span,
);
self.create_def(
self.current_hir_id_owner.def_id,
*def_node_id,
DefPathData::TypeNs(ident.name),
span,
);
let (param, bounds, path) = self.lower_universal_param_and_bounds(
*def_node_id,
span,