diff options
| author | Christopher Durham <cad97@cad97.com> | 2017-12-30 22:18:39 -0500 |
|---|---|---|
| committer | Christopher Durham <cad97@cad97.com> | 2017-12-30 22:18:39 -0500 |
| commit | 077ba8a7991ed3706cb2ebe2982607402a86f618 (patch) | |
| tree | d6daeeee72e0db3bd2f756ad6adba4da97cc50f2 | |
| parent | d4077ad62152f1e1f1137afbdae76fcecee6fad0 (diff) | |
| download | rust-077ba8a7991ed3706cb2ebe2982607402a86f618.tar.gz rust-077ba8a7991ed3706cb2ebe2982607402a86f618.zip | |
Fix rust-lang/rust#46976
| -rw-r--r-- | src/librustc/hir/lowering.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 6fc35e5302d..4383e0c9432 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -995,9 +995,10 @@ impl<'a> LoweringContext<'a> { ); let hir_bounds = self.lower_bounds(bounds, itctx); + // Set the name to `impl Bound1 + Bound2` + let name = Symbol::intern(&pprust::ty_to_string(t)); self.in_band_ty_params.push(hir::TyParam { - // Set the name to `impl Bound1 + Bound2` - name: Symbol::intern(&pprust::ty_to_string(t)), + name, id: def_node_id, bounds: hir_bounds, default: None, @@ -1009,7 +1010,7 @@ impl<'a> LoweringContext<'a> { hir::TyPath(hir::QPath::Resolved(None, P(hir::Path { span, def: Def::TyParam(DefId::local(def_index)), - segments: vec![].into(), + segments: hir_vec![hir::PathSegment::from_name(name)], }))) }, ImplTraitContext::Disallowed => { |
