diff options
| author | kadmin <julianknodt@gmail.com> | 2022-01-08 09:28:12 +0000 |
|---|---|---|
| committer | kadmin <julianknodt@gmail.com> | 2022-01-17 17:44:56 +0000 |
| commit | 67f56671d0384bdb2d92dddebfbf42510b16e0f7 (patch) | |
| tree | 40e044743da8fab20f86e317f65f1276e78343c5 /compiler/rustc_hir_pretty/src | |
| parent | fb57b7518d207caa99bdd99f4dab2a7d3902a83a (diff) | |
| download | rust-67f56671d0384bdb2d92dddebfbf42510b16e0f7.tar.gz rust-67f56671d0384bdb2d92dddebfbf42510b16e0f7.zip | |
Use Term in ProjectionPredicate
ProjectionPredicate should be able to handle both associated types and consts so this adds the first step of that. It mainly just pipes types all the way down, not entirely sure how to handle consts, but hopefully that'll come with time.
Diffstat (limited to 'compiler/rustc_hir_pretty/src')
| -rw-r--r-- | compiler/rustc_hir_pretty/src/lib.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index a76af35a8e6..a301c5e3456 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -6,7 +6,7 @@ use rustc_ast_pretty::pp::Breaks::{Consistent, Inconsistent}; use rustc_ast_pretty::pp::{self, Breaks}; use rustc_ast_pretty::pprust::{Comments, PrintState}; use rustc_hir as hir; -use rustc_hir::{GenericArg, GenericParam, GenericParamKind, Node}; +use rustc_hir::{GenericArg, GenericParam, GenericParamKind, Node, Term}; use rustc_hir::{GenericBound, PatKind, RangeEnd, TraitBoundModifier}; use rustc_span::source_map::{SourceMap, Spanned}; use rustc_span::symbol::{kw, Ident, IdentPrinter, Symbol}; @@ -1752,13 +1752,12 @@ impl<'a> State<'a> { self.print_generic_args(binding.gen_args, false, false); self.space(); match generic_args.bindings[0].kind { - hir::TypeBindingKind::Equality { ref ty } => { + hir::TypeBindingKind::Equality { ref term } => { self.word_space("="); - self.print_type(ty); - } - hir::TypeBindingKind::Const { ref c } => { - self.word_space("="); - self.print_anon_const(c); + match term { + Term::Ty(ref ty) => self.print_type(ty), + Term::Const(ref c) => self.print_anon_const(c), + } } hir::TypeBindingKind::Constraint { bounds } => { self.print_bounds(":", bounds); |
