diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2023-12-20 20:27:23 +0100 |
|---|---|---|
| committer | León Orell Valerian Liehr <me@fmease.dev> | 2023-12-22 14:32:40 +0100 |
| commit | b09889b959c00d43803113aeda24c2ff400f2caf (patch) | |
| tree | d855ed25b2c7483ac93a9603637fe726dbb2a275 /compiler/rustc_ast_pretty/src | |
| parent | ef1b78eabe713a2068a1b0451102853dd2475a7b (diff) | |
| download | rust-b09889b959c00d43803113aeda24c2ff400f2caf.tar.gz rust-b09889b959c00d43803113aeda24c2ff400f2caf.zip | |
Rid the AST & HIR pretty printers of syntactic cruft
Diffstat (limited to 'compiler/rustc_ast_pretty/src')
| -rw-r--r-- | compiler/rustc_ast_pretty/src/pprust/state/item.rs | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state/item.rs b/compiler/rustc_ast_pretty/src/pprust/state/item.rs index 247061c5ca7..43561a1c020 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state/item.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state/item.rs @@ -5,7 +5,6 @@ use crate::pprust::state::{AnnNode, PrintState, State, INDENT_UNIT}; use ast::StaticItem; use itertools::{Itertools, Position}; use rustc_ast as ast; -use rustc_ast::GenericBound; use rustc_ast::ModKind; use rustc_span::symbol::Ident; @@ -338,21 +337,9 @@ impl<'a> State<'a> { self.word_nbsp("trait"); self.print_ident(item.ident); self.print_generic_params(&generics.params); - let mut real_bounds = Vec::with_capacity(bounds.len()); - for bound in bounds.iter() { - if let GenericBound::Trait(ptr, modifiers) = bound - && let ast::BoundPolarity::Maybe(_) = modifiers.polarity - { - self.space(); - self.word_space("for ?"); - self.print_trait_ref(&ptr.trait_ref); - } else { - real_bounds.push(bound.clone()); - } - } - if !real_bounds.is_empty() { + if !bounds.is_empty() { self.word_nbsp(":"); - self.print_type_bounds(&real_bounds); + self.print_type_bounds(bounds); } self.print_where_clause(&generics.where_clause); self.word(" "); |
