Skip to content

Commit 077ba8a

Browse files
committed
Fix #46976
1 parent d4077ad commit 077ba8a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustc/hir/lowering.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -995,9 +995,10 @@ impl<'a> LoweringContext<'a> {
995995
);
996996

997997
let hir_bounds = self.lower_bounds(bounds, itctx);
998+
// Set the name to `impl Bound1 + Bound2`
999+
let name = Symbol::intern(&pprust::ty_to_string(t));
9981000
self.in_band_ty_params.push(hir::TyParam {
999-
// Set the name to `impl Bound1 + Bound2`
1000-
name: Symbol::intern(&pprust::ty_to_string(t)),
1001+
name,
10011002
id: def_node_id,
10021003
bounds: hir_bounds,
10031004
default: None,
@@ -1009,7 +1010,7 @@ impl<'a> LoweringContext<'a> {
10091010
hir::TyPath(hir::QPath::Resolved(None, P(hir::Path {
10101011
span,
10111012
def: Def::TyParam(DefId::local(def_index)),
1012-
segments: vec![].into(),
1013+
segments: hir_vec![hir::PathSegment::from_name(name)],
10131014
})))
10141015
},
10151016
ImplTraitContext::Disallowed => {

0 commit comments

Comments
 (0)