From 66ef5f2bb55f3204d50b5011e3d15385065834c1 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Tue, 17 Jan 2017 10:41:44 +0300 Subject: [PATCH] Rename ObjectSum into TraitObject in AST/HIR --- src/librustc/hir/intravisit.rs | 2 +- src/librustc/hir/lowering.rs | 4 ++-- src/librustc/hir/mod.rs | 2 +- src/librustc/hir/print.rs | 2 +- src/librustc_incremental/calculate_svh/svh_visitor.rs | 2 +- src/librustc_passes/ast_validation.rs | 2 +- src/librustc_typeck/astconv.rs | 4 ++-- src/librustdoc/clean/mod.rs | 2 +- src/libsyntax/ast.rs | 2 +- src/libsyntax/fold.rs | 4 ++-- src/libsyntax/parse/parser.rs | 4 ++-- src/libsyntax/print/pprust.rs | 2 +- src/libsyntax/visit.rs | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/librustc/hir/intravisit.rs b/src/librustc/hir/intravisit.rs index 001a5f6e586..7527d7fb318 100644 --- a/src/librustc/hir/intravisit.rs +++ b/src/librustc/hir/intravisit.rs @@ -566,7 +566,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) { visitor.visit_ty(ty); visitor.visit_nested_body(length) } - TyObjectSum(ref bounds) => { + TyTraitObject(ref bounds) => { walk_list!(visitor, visit_ty_param_bound, bounds); } TyImplTrait(ref bounds) => { diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index ee6f91bd414..57f40e7140e 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -317,8 +317,8 @@ impl<'a> LoweringContext<'a> { let expr = self.lower_expr(expr); hir::TyTypeof(self.record_body(expr, None)) } - TyKind::ObjectSum(ref bounds) => { - hir::TyObjectSum(self.lower_bounds(bounds)) + TyKind::TraitObject(ref bounds) => { + hir::TyTraitObject(self.lower_bounds(bounds)) } TyKind::ImplTrait(ref bounds) => { hir::TyImplTrait(self.lower_bounds(bounds)) diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index c3ae0e3f276..b631d67e473 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -1216,7 +1216,7 @@ pub enum Ty_ { TyPath(QPath), /// A trait object type `Bound1 + Bound2 + Bound3` /// where `Bound` is a trait or a lifetime. - TyObjectSum(TyParamBounds), + TyTraitObject(TyParamBounds), /// An `impl Bound1 + Bound2 + Bound3` type /// where `Bound` is a trait or a lifetime. TyImplTrait(TyParamBounds), diff --git a/src/librustc/hir/print.rs b/src/librustc/hir/print.rs index c314145721f..377f2ea26ab 100644 --- a/src/librustc/hir/print.rs +++ b/src/librustc/hir/print.rs @@ -418,7 +418,7 @@ impl<'a> State<'a> { hir::TyPath(ref qpath) => { self.print_qpath(qpath, false)? } - hir::TyObjectSum(ref bounds) => { + hir::TyTraitObject(ref bounds) => { self.print_bounds("", &bounds[..])?; } hir::TyImplTrait(ref bounds) => { diff --git a/src/librustc_incremental/calculate_svh/svh_visitor.rs b/src/librustc_incremental/calculate_svh/svh_visitor.rs index c2abba5cce3..f0e86e81c07 100644 --- a/src/librustc_incremental/calculate_svh/svh_visitor.rs +++ b/src/librustc_incremental/calculate_svh/svh_visitor.rs @@ -456,7 +456,7 @@ fn saw_ty(node: &Ty_) -> SawTyComponent { TyNever => SawTyNever, TyTup(..) => SawTyTup, TyPath(_) => SawTyPath, - TyObjectSum(..) => SawTyObjectSum, + TyTraitObject(..) => SawTyObjectSum, TyImplTrait(..) => SawTyImplTrait, TyTypeof(..) => SawTyTypeof, TyInfer => SawTyInfer diff --git a/src/librustc_passes/ast_validation.rs b/src/librustc_passes/ast_validation.rs index e38fcbb5f6b..b7b027102b2 100644 --- a/src/librustc_passes/ast_validation.rs +++ b/src/librustc_passes/ast_validation.rs @@ -143,7 +143,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> { err.emit(); }); } - TyKind::ObjectSum(ref bounds) => { + TyKind::TraitObject(ref bounds) => { self.no_questions_in_bounds(bounds, "trait object types", false); } _ => {} diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index bcb82c85f24..e4529b58f03 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -1347,7 +1347,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o { match path.def { Def::Trait(trait_def_id) => { // N.B. this case overlaps somewhat with - // TyObjectSum, see that fn for details + // TyTraitObject, see that fn for details assert_eq!(opt_self_ty, None); tcx.prohibit_type_params(path.segments.split_last().unwrap().1); @@ -1525,7 +1525,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o { } tcx.mk_fn_ptr(bare_fn_ty) } - hir::TyObjectSum(ref bounds) => { + hir::TyTraitObject(ref bounds) => { self.conv_object_ty_poly_trait_ref(rscope, ast_ty.span, bounds) } hir::TyImplTrait(ref bounds) => { diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 77ca6ef34b8..a77485477b1 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1765,7 +1765,7 @@ impl Clean for hir::Ty { trait_: box resolve_type(cx, trait_path.clean(cx), self.id) } } - TyObjectSum(ref bounds) => { + TyTraitObject(ref bounds) => { let lhs_ty = bounds[0].clean(cx); match lhs_ty { TraitBound(poly_trait, ..) => { diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 2d7dfe50415..62cef26b6d1 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1359,7 +1359,7 @@ pub enum TyKind { Path(Option, Path), /// A trait object type `Bound1 + Bound2 + Bound3` /// where `Bound` is a trait or a lifetime. - ObjectSum(TyParamBounds), + TraitObject(TyParamBounds), /// An `impl Bound1 + Bound2 + Bound3` type /// where `Bound` is a trait or a lifetime. ImplTrait(TyParamBounds), diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 2acf1c8f8fb..f936fc79991 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -386,8 +386,8 @@ pub fn noop_fold_ty(t: P, fld: &mut T) -> P { TyKind::Typeof(expr) => { TyKind::Typeof(fld.fold_expr(expr)) } - TyKind::ObjectSum(bounds) => { - TyKind::ObjectSum(bounds.move_map(|b| fld.fold_ty_param_bound(b))) + TyKind::TraitObject(bounds) => { + TyKind::TraitObject(bounds.move_map(|b| fld.fold_ty_param_bound(b))) } TyKind::ImplTrait(bounds) => { TyKind::ImplTrait(bounds.move_map(|b| fld.fold_ty_param_bound(b))) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 60ad6a76f4d..62897159bf0 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1045,7 +1045,7 @@ impl<'a> Parser<'a> { Some(TraitTyParamBound(poly_trait_ref, TraitBoundModifier::None)).into_iter() .chain(other_bounds) .collect(); - Ok(ast::TyKind::ObjectSum(all_bounds)) + Ok(ast::TyKind::TraitObject(all_bounds)) } } @@ -1327,7 +1327,7 @@ impl<'a> Parser<'a> { } let sp = mk_sp(lo, self.prev_span.hi); - let sum = TyKind::ObjectSum(bounds); + let sum = TyKind::TraitObject(bounds); Ok(P(Ty {id: ast::DUMMY_NODE_ID, node: sum, span: sp})) } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index c989aa59e87..7115a38b448 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1028,7 +1028,7 @@ impl<'a> State<'a> { ast::TyKind::Path(Some(ref qself), ref path) => { self.print_qpath(path, qself, false)? } - ast::TyKind::ObjectSum(ref bounds) => { + ast::TyKind::TraitObject(ref bounds) => { self.print_bounds("", &bounds[..])?; } ast::TyKind::ImplTrait(ref bounds) => { diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index b0d7a251803..1a95e672f3c 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -346,7 +346,7 @@ pub fn walk_ty<'a, V: Visitor<'a>>(visitor: &mut V, typ: &'a Ty) { visitor.visit_ty(ty); visitor.visit_expr(expression) } - TyKind::ObjectSum(ref bounds) => { + TyKind::TraitObject(ref bounds) => { walk_list!(visitor, visit_ty_param_bound, bounds); } TyKind::ImplTrait(ref bounds) => {