]> git.lizzy.rs Git - rust.git/commitdiff
Rename TraitTyParamBound to ParamBound::Trait
authorvarkor <github@varkor.com>
Thu, 14 Jun 2018 10:25:14 +0000 (11:25 +0100)
committervarkor <github@varkor.com>
Wed, 20 Jun 2018 11:23:23 +0000 (12:23 +0100)
17 files changed:
src/librustc/hir/intravisit.rs
src/librustc/hir/lowering.rs
src/librustc/hir/mod.rs
src/librustc/hir/print.rs
src/librustc/ich/impls_hir.rs
src/librustc/middle/resolve_lifetime.rs
src/librustc_passes/ast_validation.rs
src/librustc_privacy/lib.rs
src/librustc_save_analysis/dump_visitor.rs
src/librustc_typeck/collect.rs
src/librustdoc/clean/mod.rs
src/libsyntax/ast.rs
src/libsyntax/ext/build.rs
src/libsyntax/fold.rs
src/libsyntax/parse/parser.rs
src/libsyntax/print/pprust.rs
src/libsyntax/visit.rs

index 9c154d2e4af125c34c279b84f6b92f44fc4b3d60..a66650aa161f24b938589b823888ea7ff6fbd503 100644 (file)
@@ -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),
     }
 }
 
index 7ef72fd75423a43a0bd006e29baecc85ff86ed03..2a231448490030189cf1c82f9733e0d55ad71954 100644 (file)
@@ -1108,10 +1108,10 @@ fn lower_ty(&mut self, t: &Ty, itctx: ImplTraitContext) -> P<hir::Ty> {
                 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 @@ fn lower_param_bound(
         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 @@ fn lower_generics(
         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 @@ fn lower_where_predicate(&mut self, pred: &WherePredicate) -> hir::WherePredicat
                                 .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,
index ab7e8c4e81341c59bf4a7474f6ddaf5c0eed961b..974d287cd9731badf0caa905c3c0dcd8a9bd1b2e 100644 (file)
@@ -22,7 +22,6 @@
 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,
         }
     }
 }
index 56a4c2d3cb56717f45041367d571458059f479fc..b6fd136255421e3bf1875efbf0e05e1f14cbd0ce 100644 (file)
@@ -24,7 +24,7 @@
 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 @@ pub fn print_item(&mut self, item: &hir::Item) -> io::Result<()> {
                 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 @@ pub fn print_item(&mut self, item: &hir::Item) -> io::Result<()> {
                 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 @@ pub fn print_bounds(&mut self, prefix: &str, bounds: &[hir::ParamBound]) -> io::
                 }
 
                 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 @@ pub fn print_generic_param(&mut self, param: &GenericParam) -> io::Result<()> {
                 let mut sep = ":";
                 for bound in &param.bounds {
                     match bound {
-                        hir::ParamBound::Outlives(lt) => {
+                        ParamBound::Outlives(lt) => {
                             self.s.word(sep)?;
                             self.print_lifetime(lt)?;
                             sep = "+";
@@ -2181,7 +2181,7 @@ pub fn print_where_clause(&mut self, where_clause: &hir::WhereClause) -> io::Res
 
                     for (i, bound) in bounds.iter().enumerate() {
                         match bound {
-                            hir::ParamBound::Outlives(lt) => {
+                            ParamBound::Outlives(lt) => {
                                 self.print_lifetime(lt)?;
                             }
                             _ => bug!(),
index 51934ad8e6a8cd5bdfab41d4db08bddf7e092654..ec55a05822cacbddd36d834e976db6d2334dcb33 100644 (file)
@@ -189,7 +189,7 @@ fn hash_stable<W: StableHasherResult>(&self,
 });
 
 impl_stable_hash_for!(enum hir::ParamBound {
-    TraitTyParamBound(poly_trait_ref, trait_bound_modifier),
+    Trait(poly_trait_ref, trait_bound_modifier),
     Outlives(lifetime)
 });
 
index 2461a1436bced1592817ea04980cc8d505e1c0e6..14c782308a801226af744ff4f209129760dcabb5 100644 (file)
@@ -1256,7 +1256,7 @@ fn object_lifetime_defaults_for_item(
 ) -> Vec<ObjectLifetimeDefault> {
     fn add_bounds(set: &mut Set1<hir::LifetimeName>, 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);
             }
         }
index 3411c28f35bcaebc6233319d3110199ac201c30f..bdfe1d50e26869f61cfbe303f716062554d503d4 100644 (file)
@@ -101,7 +101,7 @@ fn check_trait_fn_not_const(&self, constness: Spanned<Constness>) {
 
     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 @@ fn visit_ty(&mut self, ty: &'a Ty) {
             }
             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");
                 }
             }
index 2667f68b26095560e95f9d25e70f610d234983ab..68b5a925ef3a0bb652a0c44eb29832891a454d1c 100644 (file)
@@ -1039,7 +1039,7 @@ fn trait_is_public(&self, trait_id: ast::NodeId) -> bool {
 
     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);
             }
index cbae6c1ab1ab876425562b801c631f8ed36ec4af..1373ee94587a577ae7a3991fe3138665cc8eb0a0 100644 (file)
@@ -761,7 +761,7 @@ fn process_trait(
         // 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 @@ fn visit_generics(&mut self, generics: &'l ast::Generics) {
             ast::GenericParamKind::Lifetime { .. } => {}
             ast::GenericParamKind::Type { ref default, .. } => {
                 for bound in &param.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)
                     }
                 }
index eb18916e7815303674a4bb799f9bb9b361a262f0..f578d4f1ae6ab489ca9f6e75637b0cfa98cbdb40 100644 (file)
@@ -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<ty::Predicate<'tcx>>
 {
     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![],
     }
 }
 
index 2b02c639b954ad735417b2dd7275eb9f6eabe89c..7f9500d21f0189af51af25bd1b694029acff7fa6 100644 (file)
@@ -1510,8 +1510,8 @@ fn get_trait_type(&self) -> Option<Type> {
 impl Clean<ParamBound> 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<Option<Vec<ParamBound>>> for Substs<'tcx> {
     fn clean(&self, cx: &DocContext) -> Option<Vec<ParamBound>> {
         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 @@ fn clean(&self, cx: &DocContext) -> Type {
                     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 @@ fn clean(&self, cx: &DocContext) -> Type {
                         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;
index 389afa96ea02618b8c37ed2b36271b58eb4c8e0d..6fe90025ff8e5afdab86ab3c68797ca73b09e7ec 100644 (file)
@@ -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 @@ pub fn returns(&self) -> bool {
     fn to_bound(&self) -> Option<ParamBound> {
         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,
         }
index cc0bc7f0c745f54e9418184005fc75385d7a2aa5..28bfb1ff81110d35f7f42fb330f95147be1b2c90 100644 (file)
@@ -465,7 +465,7 @@ fn poly_trait_ref(&self, span: Span, path: ast::Path) -> ast::PolyTraitRef {
     }
 
     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 {
index 804b1410b0786479d1fe232982132ef50bd5a519..290607a702b171a69c0d9d21a138d534d7e8b473 100644 (file)
@@ -678,8 +678,8 @@ pub fn noop_fold_fn_decl<T: Folder>(decl: P<FnDecl>, fld: &mut T) -> P<FnDecl> {
 
 pub fn noop_fold_param_bound<T>(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)),
     }
index f69361c28ad00d5588fe9472f2c5dfc5428c55b3..75eefb844321c9322774d6d1bee77d841e4f687e 100644 (file)
@@ -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 @@ fn parse_ty_common(&mut self, allow_plus: bool, allow_qpath_recovery: bool)
                     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 @@ fn parse_ty_common(&mut self, allow_plus: bool, allow_qpath_recovery: bool)
     fn parse_remaining_bounds(&mut self, generic_params: Vec<GenericParam>, 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 @@ fn parse_ty_param_bounds_common(&mut self, allow_plus: bool) -> PResult<'a, Para
                     } else {
                         TraitBoundModifier::None
                     };
-                    bounds.push(TraitTyParamBound(poly_trait, modifier));
+                    bounds.push(Trait(poly_trait, modifier));
                 }
             } else {
                 break
index 5d39367f4b0d48f0580df6d24084f439aaae07a9..38229fa499876b5f78d82291aad8349e1e4cef20 100644 (file)
@@ -12,7 +12,7 @@
 
 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 @@ pub fn print_item(&mut self, item: &ast::Item) -> io::Result<()> {
                 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 @@ pub fn print_item(&mut self, item: &ast::Item) -> io::Result<()> {
                 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 @@ pub fn print_type_bounds(&mut self,
                 }
 
                 match bound {
-                    TraitTyParamBound(tref, modifier) => {
+                    Trait(tref, modifier) => {
                         if modifier == &TraitBoundModifier::Maybe {
                             self.s.word("?")?;
                         }
index f63b474f450aa99cf40e3bd896d846e490a8d0d8..6beaabd03de71316ad5da78d2175584a67e58b71 100644 (file)
@@ -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) => {