From 7de6ed06a528db8f34ca3e75ded9d77ab9ba8b9a Mon Sep 17 00:00:00 2001 From: varkor Date: Thu, 14 Jun 2018 11:25:14 +0100 Subject: [PATCH] Rename TraitTyParamBound to ParamBound::Trait --- src/librustc/hir/intravisit.rs | 4 ++-- src/librustc/hir/lowering.rs | 14 ++++++------ src/librustc/hir/mod.rs | 7 +++--- src/librustc/hir/print.rs | 14 ++++++------ src/librustc/ich/impls_hir.rs | 2 +- src/librustc/middle/resolve_lifetime.rs | 2 +- src/librustc_passes/ast_validation.rs | 4 ++-- src/librustc_privacy/lib.rs | 2 +- src/librustc_save_analysis/dump_visitor.rs | 4 ++-- src/librustc_typeck/collect.rs | 26 ++++++++-------------- src/librustdoc/clean/mod.rs | 12 +++++----- src/libsyntax/ast.rs | 6 ++--- src/libsyntax/ext/build.rs | 2 +- src/libsyntax/fold.rs | 4 ++-- src/libsyntax/parse/parser.rs | 8 +++---- src/libsyntax/print/pprust.rs | 8 +++---- src/libsyntax/visit.rs | 2 +- 17 files changed, 57 insertions(+), 64 deletions(-) diff --git a/src/librustc/hir/intravisit.rs b/src/librustc/hir/intravisit.rs index 9c154d2e4af1..a66650aa161f 100644 --- a/src/librustc/hir/intravisit.rs +++ b/src/librustc/hir/intravisit.rs @@ -733,10 +733,10 @@ pub fn walk_foreign_item<'v, V: Visitor<'v>>(visitor: &mut V, foreign_item: &'v pub fn walk_param_bound<'v, V: Visitor<'v>>(visitor: &mut V, bound: &'v ParamBound) { match *bound { - TraitTyParamBound(ref typ, modifier) => { + ParamBound::Trait(ref typ, modifier) => { visitor.visit_poly_trait_ref(typ, modifier); } - Outlives(ref lifetime) => visitor.visit_lifetime(lifetime), + ParamBound::Outlives(ref lifetime) => visitor.visit_lifetime(lifetime), } } diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 7ef72fd75423..2a2314484900 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -1108,10 +1108,10 @@ impl<'a> LoweringContext<'a> { let bounds = bounds .iter() .filter_map(|bound| match *bound { - TraitTyParamBound(ref ty, TraitBoundModifier::None) => { + Trait(ref ty, TraitBoundModifier::None) => { Some(self.lower_poly_trait_ref(ty, itctx)) } - TraitTyParamBound(_, TraitBoundModifier::Maybe) => None, + Trait(_, TraitBoundModifier::Maybe) => None, Outlives(ref lifetime) => { if lifetime_bound.is_none() { lifetime_bound = Some(self.lower_lifetime(lifetime)); @@ -1875,12 +1875,12 @@ impl<'a> LoweringContext<'a> { itctx: ImplTraitContext, ) -> hir::ParamBound { match *tpb { - TraitTyParamBound(ref ty, modifier) => hir::TraitTyParamBound( + ParamBound::Trait(ref ty, modifier) => hir::ParamBound::Trait( self.lower_poly_trait_ref(ty, itctx), self.lower_trait_bound_modifier(modifier), ), - Outlives(ref lifetime) => { - hir::Outlives(self.lower_lifetime(lifetime)) + ParamBound::Outlives(ref lifetime) => { + hir::ParamBound::Outlives(self.lower_lifetime(lifetime)) } } } @@ -2010,7 +2010,7 @@ impl<'a> LoweringContext<'a> { for pred in &generics.where_clause.predicates { if let WherePredicate::BoundPredicate(ref bound_pred) = *pred { 'next_bound: for bound in &bound_pred.bounds { - if let TraitTyParamBound(_, TraitBoundModifier::Maybe) = *bound { + if let ParamBound::Trait(_, TraitBoundModifier::Maybe) = *bound { let report_error = |this: &mut Self| { this.diagnostic().span_err( bound_pred.bounded_ty.span, @@ -2095,7 +2095,7 @@ impl<'a> LoweringContext<'a> { .filter_map(|bound| match *bound { // Ignore `?Trait` bounds. // Tthey were copied into type parameters already. - TraitTyParamBound(_, TraitBoundModifier::Maybe) => None, + ParamBound::Trait(_, TraitBoundModifier::Maybe) => None, _ => Some(this.lower_param_bound( bound, ImplTraitContext::Disallowed, diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index ab7e8c4e8134..974d287cd973 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -22,7 +22,6 @@ pub use self::Mutability::*; pub use self::PrimTy::*; pub use self::Stmt_::*; pub use self::Ty_::*; -pub use self::ParamBound::*; pub use self::UnOp::*; pub use self::UnsafeSource::*; pub use self::Visibility::{Public, Inherited}; @@ -445,15 +444,15 @@ pub enum TraitBoundModifier { /// detects Copy, Send and Sync. #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum ParamBound { - TraitTyParamBound(PolyTraitRef, TraitBoundModifier), + Trait(PolyTraitRef, TraitBoundModifier), Outlives(Lifetime), } impl ParamBound { pub fn span(&self) -> Span { match self { - &TraitTyParamBound(ref t, ..) => t.span, - &Outlives(ref l) => l.span, + &ParamBound::Trait(ref t, ..) => t.span, + &ParamBound::Outlives(ref l) => l.span, } } } diff --git a/src/librustc/hir/print.rs b/src/librustc/hir/print.rs index 56a4c2d3cb56..b6fd13625542 100644 --- a/src/librustc/hir/print.rs +++ b/src/librustc/hir/print.rs @@ -24,7 +24,7 @@ use syntax::util::parser::{self, AssocOp, Fixity}; use syntax_pos::{self, BytePos, FileName}; use hir; -use hir::{PatKind, Outlives, TraitTyParamBound, TraitBoundModifier, RangeEnd}; +use hir::{PatKind, ParamBound, TraitBoundModifier, RangeEnd}; use hir::{GenericParam, GenericParamKind, GenericArg}; use std::cell::Cell; @@ -740,7 +740,7 @@ impl<'a> State<'a> { self.print_generic_params(&generics.params)?; let mut real_bounds = Vec::with_capacity(bounds.len()); for b in bounds.iter() { - if let TraitTyParamBound(ref ptr, hir::TraitBoundModifier::Maybe) = *b { + if let ParamBound::Trait(ref ptr, hir::TraitBoundModifier::Maybe) = *b { self.s.space()?; self.word_space("for ?")?; self.print_trait_ref(&ptr.trait_ref)?; @@ -766,7 +766,7 @@ impl<'a> State<'a> { let mut real_bounds = Vec::with_capacity(bounds.len()); // FIXME(durka) this seems to be some quite outdated syntax for b in bounds.iter() { - if let TraitTyParamBound(ref ptr, hir::TraitBoundModifier::Maybe) = *b { + if let ParamBound::Trait(ref ptr, hir::TraitBoundModifier::Maybe) = *b { self.s.space()?; self.word_space("for ?")?; self.print_trait_ref(&ptr.trait_ref)?; @@ -2086,13 +2086,13 @@ impl<'a> State<'a> { } match bound { - TraitTyParamBound(tref, modifier) => { + ParamBound::Trait(tref, modifier) => { if modifier == &TraitBoundModifier::Maybe { self.s.word("?")?; } self.print_poly_trait_ref(tref)?; } - Outlives(lt) => { + ParamBound::Outlives(lt) => { self.print_lifetime(lt)?; } } @@ -2121,7 +2121,7 @@ impl<'a> State<'a> { let mut sep = ":"; for bound in ¶m.bounds { match bound { - hir::ParamBound::Outlives(lt) => { + ParamBound::Outlives(lt) => { self.s.word(sep)?; self.print_lifetime(lt)?; sep = "+"; @@ -2181,7 +2181,7 @@ impl<'a> State<'a> { for (i, bound) in bounds.iter().enumerate() { match bound { - hir::ParamBound::Outlives(lt) => { + ParamBound::Outlives(lt) => { self.print_lifetime(lt)?; } _ => bug!(), diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc/ich/impls_hir.rs index 51934ad8e6a8..ec55a05822ca 100644 --- a/src/librustc/ich/impls_hir.rs +++ b/src/librustc/ich/impls_hir.rs @@ -189,7 +189,7 @@ impl_stable_hash_for!(struct hir::GenericArgs { }); impl_stable_hash_for!(enum hir::ParamBound { - TraitTyParamBound(poly_trait_ref, trait_bound_modifier), + Trait(poly_trait_ref, trait_bound_modifier), Outlives(lifetime) }); diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index 2461a1436bce..14c782308a80 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -1256,7 +1256,7 @@ fn object_lifetime_defaults_for_item( ) -> Vec { fn add_bounds(set: &mut Set1, bounds: &[hir::ParamBound]) { for bound in bounds { - if let hir::Outlives(ref lifetime) = *bound { + if let hir::ParamBound::Outlives(ref lifetime) = *bound { set.insert(lifetime.name); } } diff --git a/src/librustc_passes/ast_validation.rs b/src/librustc_passes/ast_validation.rs index 3411c28f35bc..bdfe1d50e268 100644 --- a/src/librustc_passes/ast_validation.rs +++ b/src/librustc_passes/ast_validation.rs @@ -101,7 +101,7 @@ impl<'a> AstValidator<'a> { fn no_questions_in_bounds(&self, bounds: &ParamBounds, where_: &str, is_trait: bool) { for bound in bounds { - if let TraitTyParamBound(ref poly, TraitBoundModifier::Maybe) = *bound { + if let Trait(ref poly, TraitBoundModifier::Maybe) = *bound { let mut err = self.err_handler().struct_span_err(poly.span, &format!("`?Trait` is not permitted in {}", where_)); if is_trait { @@ -203,7 +203,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> { } TyKind::ImplTrait(ref bounds) => { if !bounds.iter() - .any(|b| if let TraitTyParamBound(..) = *b { true } else { false }) { + .any(|b| if let Trait(..) = *b { true } else { false }) { self.err_handler().span_err(ty.span, "at least one trait must be specified"); } } diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 2667f68b2609..68b5a925ef3a 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -1039,7 +1039,7 @@ impl<'a, 'tcx> ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> { fn check_ty_param_bound(&mut self, ty_param_bound: &hir::ParamBound) { - if let hir::TraitTyParamBound(ref trait_ref, _) = *ty_param_bound { + if let hir::ParamBound::Trait(ref trait_ref, _) = *ty_param_bound { if self.path_is_private_type(&trait_ref.trait_ref.path) { self.old_error_set.insert(trait_ref.trait_ref.ref_id); } diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index cbae6c1ab1ab..1373ee94587a 100644 --- a/src/librustc_save_analysis/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -761,7 +761,7 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> { // super-traits for super_bound in trait_refs.iter() { let trait_ref = match *super_bound { - ast::TraitTyParamBound(ref trait_ref, _) => trait_ref, + ast::Trait(ref trait_ref, _) => trait_ref, ast::Outlives(..) => { continue; } @@ -1489,7 +1489,7 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc ast::GenericParamKind::Lifetime { .. } => {} ast::GenericParamKind::Type { ref default, .. } => { for bound in ¶m.bounds { - if let ast::TraitTyParamBound(ref trait_ref, _) = *bound { + if let ast::Trait(ref trait_ref, _) = *bound { self.process_path(trait_ref.trait_ref.ref_id, &trait_ref.trait_ref.path) } } diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index eb18916e7815..f578d4f1ae6a 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -1257,7 +1257,7 @@ fn is_unsized<'gcx: 'tcx, 'tcx>(astconv: &AstConv<'gcx, 'tcx>, // Try to find an unbound in bounds. let mut unbound = None; for ab in ast_bounds { - if let &hir::TraitTyParamBound(ref ptr, hir::TraitBoundModifier::Maybe) = ab { + if let &hir::ParamBound::Trait(ref ptr, hir::TraitBoundModifier::Maybe) = ab { if unbound.is_none() { unbound = Some(ptr.trait_ref.clone()); } else { @@ -1482,7 +1482,7 @@ pub fn explicit_predicates_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, for bound in bound_pred.bounds.iter() { match bound { - &hir::ParamBound::TraitTyParamBound(ref poly_trait_ref, _) => { + &hir::ParamBound::Trait(ref poly_trait_ref, _) => { let mut projections = Vec::new(); let trait_ref = @@ -1591,22 +1591,16 @@ pub fn compute_bounds<'gcx: 'tcx, 'tcx>(astconv: &AstConv<'gcx, 'tcx>, let mut trait_bounds = vec![]; for ast_bound in ast_bounds { match *ast_bound { - hir::TraitTyParamBound(ref b, hir::TraitBoundModifier::None) => { - trait_bounds.push(b); - } - hir::TraitTyParamBound(_, hir::TraitBoundModifier::Maybe) => {} - hir::Outlives(ref l) => { - region_bounds.push(l); - } + hir::ParamBound::Trait(ref b, hir::TraitBoundModifier::None) => trait_bounds.push(b), + hir::ParamBound::Trait(_, hir::TraitBoundModifier::Maybe) => {} + hir::ParamBound::Outlives(ref l) => region_bounds.push(l), } } let mut projection_bounds = vec![]; let mut trait_bounds: Vec<_> = trait_bounds.iter().map(|&bound| { - astconv.instantiate_poly_trait_ref(bound, - param_ty, - &mut projection_bounds) + astconv.instantiate_poly_trait_ref(bound, param_ty, &mut projection_bounds) }).collect(); let region_bounds = region_bounds.into_iter().map(|r| { @@ -1640,7 +1634,7 @@ fn predicates_from_bound<'tcx>(astconv: &AstConv<'tcx, 'tcx>, -> Vec> { match *bound { - hir::TraitTyParamBound(ref tr, hir::TraitBoundModifier::None) => { + hir::ParamBound::Trait(ref tr, hir::TraitBoundModifier::None) => { let mut projections = Vec::new(); let pred = astconv.instantiate_poly_trait_ref(tr, param_ty, @@ -1650,14 +1644,12 @@ fn predicates_from_bound<'tcx>(astconv: &AstConv<'tcx, 'tcx>, .chain(Some(pred.to_predicate())) .collect() } - hir::Outlives(ref lifetime) => { + hir::ParamBound::Outlives(ref lifetime) => { let region = astconv.ast_region_to_region(lifetime, None); let pred = ty::Binder::bind(ty::OutlivesPredicate(param_ty, region)); vec![ty::Predicate::TypeOutlives(pred)] } - hir::TraitTyParamBound(_, hir::TraitBoundModifier::Maybe) => { - Vec::new() - } + hir::ParamBound::Trait(_, hir::TraitBoundModifier::Maybe) => vec![], } } diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 2b02c639b954..7f9500d21f01 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1510,8 +1510,8 @@ impl ParamBound { impl Clean for hir::ParamBound { fn clean(&self, cx: &DocContext) -> ParamBound { match *self { - hir::Outlives(lt) => Outlives(lt.clean(cx)), - hir::TraitTyParamBound(ref t, modifier) => TraitBound(t.clean(cx), modifier), + hir::ParamBound::Outlives(lt) => Outlives(lt.clean(cx)), + hir::ParamBound::Trait(ref t, modifier) => TraitBound(t.clean(cx), modifier), } } } @@ -1624,7 +1624,7 @@ impl<'tcx> Clean>> for Substs<'tcx> { fn clean(&self, cx: &DocContext) -> Option> { let mut v = Vec::new(); v.extend(self.regions().filter_map(|r| r.clean(cx)) - .map(Outlives)); + .map(ParamBound::Outlives)); v.extend(self.types().map(|t| TraitBound(PolyTrait { trait_: t.clean(cx), generic_params: Vec::new(), @@ -3080,7 +3080,7 @@ impl<'tcx> Clean for Ty<'tcx> { inline::record_extern_fqn(cx, did, TypeKind::Trait); let mut typarams = vec![]; - reg.clean(cx).map(|b| typarams.push(Outlives(b))); + reg.clean(cx).map(|b| typarams.push(ParamBound::Outlives(b))); for did in obj.auto_traits() { let empty = cx.tcx.intern_substs(&[]); let path = external_path(cx, &cx.tcx.item_name(did).as_str(), @@ -3137,7 +3137,9 @@ impl<'tcx> Clean for Ty<'tcx> { tr } else if let ty::Predicate::TypeOutlives(pred) = *predicate { // these should turn up at the end - pred.skip_binder().1.clean(cx).map(|r| regions.push(Outlives(r))); + pred.skip_binder().1.clean(cx).map(|r| { + regions.push(ParamBound::Outlives(r)) + }); return None; } else { return None; diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 389afa96ea02..6fe90025ff8e 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -283,14 +283,14 @@ pub enum TraitBoundModifier { /// detects Copy, Send and Sync. #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum ParamBound { - TraitTyParamBound(PolyTraitRef, TraitBoundModifier), + Trait(PolyTraitRef, TraitBoundModifier), Outlives(Lifetime) } impl ParamBound { pub fn span(&self) -> Span { match self { - &TraitTyParamBound(ref t, ..) => t.span, + &Trait(ref t, ..) => t.span, &Outlives(ref l) => l.ident.span, } } @@ -930,7 +930,7 @@ impl Expr { fn to_bound(&self) -> Option { match &self.node { ExprKind::Path(None, path) => - Some(TraitTyParamBound(PolyTraitRef::new(Vec::new(), path.clone(), self.span), + Some(Trait(PolyTraitRef::new(Vec::new(), path.clone(), self.span), TraitBoundModifier::None)), _ => None, } diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index cc0bc7f0c745..28bfb1ff8111 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -465,7 +465,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { } fn ty_param_bound(&self, path: ast::Path) -> ast::ParamBound { - ast::TraitTyParamBound(self.poly_trait_ref(path.span, path), ast::TraitBoundModifier::None) + ast::Trait(self.poly_trait_ref(path.span, path), ast::TraitBoundModifier::None) } fn lifetime(&self, span: Span, ident: ast::Ident) -> ast::Lifetime { diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 804b1410b078..290607a702b1 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -678,8 +678,8 @@ pub fn noop_fold_fn_decl(decl: P, fld: &mut T) -> P { pub fn noop_fold_param_bound(pb: ParamBound, fld: &mut T) -> ParamBound where T: Folder { match pb { - TraitTyParamBound(ty, modifier) => { - TraitTyParamBound(fld.fold_poly_trait_ref(ty), modifier) + Trait(ty, modifier) => { + Trait(fld.fold_poly_trait_ref(ty), modifier) } Outlives(lifetime) => Outlives(noop_fold_lifetime(lifetime, fld)), } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f69361c28ad0..75eefb844321 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -10,7 +10,7 @@ use rustc_target::spec::abi::{self, Abi}; use ast::{AngleBracketedArgs, ParenthesizedArgData, AttrStyle, BareFnTy}; -use ast::{Outlives, TraitTyParamBound, TraitBoundModifier}; +use ast::{Outlives, Trait, TraitBoundModifier}; use ast::Unsafety; use ast::{Mod, AnonConst, Arg, Arm, Attribute, BindingMode, TraitItemKind}; use ast::Block; @@ -1444,7 +1444,7 @@ impl<'a> Parser<'a> { TyKind::TraitObject(ref bounds, TraitObjectSyntax::None) if maybe_bounds && bounds.len() == 1 && !trailing_plus => { let path = match bounds[0] { - TraitTyParamBound(ref pt, ..) => pt.trait_ref.path.clone(), + Trait(ref pt, ..) => pt.trait_ref.path.clone(), _ => self.bug("unexpected lifetime bound"), }; self.parse_remaining_bounds(Vec::new(), path, lo, true)? @@ -1566,7 +1566,7 @@ impl<'a> Parser<'a> { fn parse_remaining_bounds(&mut self, generic_params: Vec, path: ast::Path, lo: Span, parse_plus: bool) -> PResult<'a, TyKind> { let poly_trait_ref = PolyTraitRef::new(generic_params, path, lo.to(self.prev_span)); - let mut bounds = vec![TraitTyParamBound(poly_trait_ref, TraitBoundModifier::None)]; + let mut bounds = vec![Trait(poly_trait_ref, TraitBoundModifier::None)]; if parse_plus { self.eat_plus(); // `+`, or `+=` gets split and `+` is discarded bounds.append(&mut self.parse_ty_param_bounds()?); @@ -4770,7 +4770,7 @@ impl<'a> Parser<'a> { } else { TraitBoundModifier::None }; - bounds.push(TraitTyParamBound(poly_trait, modifier)); + bounds.push(Trait(poly_trait, modifier)); } } else { break diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 5d39367f4b0d..38229fa49987 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -12,7 +12,7 @@ pub use self::AnnNode::*; use rustc_target::spec::abi::{self, Abi}; use ast::{self, BlockCheckMode, PatKind, RangeEnd, RangeSyntax}; -use ast::{SelfKind, Outlives, TraitTyParamBound, TraitBoundModifier}; +use ast::{SelfKind, Outlives, Trait, TraitBoundModifier}; use ast::{Attribute, MacDelimiter, GenericArg}; use util::parser::{self, AssocOp, Fixity}; use attr; @@ -1364,7 +1364,7 @@ impl<'a> State<'a> { self.print_generic_params(&generics.params)?; let mut real_bounds = Vec::with_capacity(bounds.len()); for b in bounds.iter() { - if let TraitTyParamBound(ref ptr, ast::TraitBoundModifier::Maybe) = *b { + if let Trait(ref ptr, ast::TraitBoundModifier::Maybe) = *b { self.s.space()?; self.word_space("for ?")?; self.print_trait_ref(&ptr.trait_ref)?; @@ -1390,7 +1390,7 @@ impl<'a> State<'a> { let mut real_bounds = Vec::with_capacity(bounds.len()); // FIXME(durka) this seems to be some quite outdated syntax for b in bounds.iter() { - if let TraitTyParamBound(ref ptr, ast::TraitBoundModifier::Maybe) = *b { + if let Trait(ref ptr, ast::TraitBoundModifier::Maybe) = *b { self.s.space()?; self.word_space("for ?")?; self.print_trait_ref(&ptr.trait_ref)?; @@ -2826,7 +2826,7 @@ impl<'a> State<'a> { } match bound { - TraitTyParamBound(tref, modifier) => { + Trait(tref, modifier) => { if modifier == &TraitBoundModifier::Maybe { self.s.word("?")?; } diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index f63b474f450a..6beaabd03de7 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -481,7 +481,7 @@ pub fn walk_global_asm<'a, V: Visitor<'a>>(_: &mut V, _: &'a GlobalAsm) { pub fn walk_param_bound<'a, V: Visitor<'a>>(visitor: &mut V, bound: &'a ParamBound) { match *bound { - TraitTyParamBound(ref typ, ref modifier) => { + Trait(ref typ, ref modifier) => { visitor.visit_poly_trait_ref(typ, modifier); } Outlives(ref lifetime) => {