Skip to content

Commit 66ef5f2

Browse files
committed
Rename ObjectSum into TraitObject in AST/HIR
1 parent 869b816 commit 66ef5f2

File tree

13 files changed

+17
-17
lines changed

13 files changed

+17
-17
lines changed

src/librustc/hir/intravisit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
566566
visitor.visit_ty(ty);
567567
visitor.visit_nested_body(length)
568568
}
569-
TyObjectSum(ref bounds) => {
569+
TyTraitObject(ref bounds) => {
570570
walk_list!(visitor, visit_ty_param_bound, bounds);
571571
}
572572
TyImplTrait(ref bounds) => {

src/librustc/hir/lowering.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,8 @@ impl<'a> LoweringContext<'a> {
317317
let expr = self.lower_expr(expr);
318318
hir::TyTypeof(self.record_body(expr, None))
319319
}
320-
TyKind::ObjectSum(ref bounds) => {
321-
hir::TyObjectSum(self.lower_bounds(bounds))
320+
TyKind::TraitObject(ref bounds) => {
321+
hir::TyTraitObject(self.lower_bounds(bounds))
322322
}
323323
TyKind::ImplTrait(ref bounds) => {
324324
hir::TyImplTrait(self.lower_bounds(bounds))

src/librustc/hir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ pub enum Ty_ {
12161216
TyPath(QPath),
12171217
/// A trait object type `Bound1 + Bound2 + Bound3`
12181218
/// where `Bound` is a trait or a lifetime.
1219-
TyObjectSum(TyParamBounds),
1219+
TyTraitObject(TyParamBounds),
12201220
/// An `impl Bound1 + Bound2 + Bound3` type
12211221
/// where `Bound` is a trait or a lifetime.
12221222
TyImplTrait(TyParamBounds),

src/librustc/hir/print.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ impl<'a> State<'a> {
418418
hir::TyPath(ref qpath) => {
419419
self.print_qpath(qpath, false)?
420420
}
421-
hir::TyObjectSum(ref bounds) => {
421+
hir::TyTraitObject(ref bounds) => {
422422
self.print_bounds("", &bounds[..])?;
423423
}
424424
hir::TyImplTrait(ref bounds) => {

src/librustc_incremental/calculate_svh/svh_visitor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ fn saw_ty(node: &Ty_) -> SawTyComponent {
456456
TyNever => SawTyNever,
457457
TyTup(..) => SawTyTup,
458458
TyPath(_) => SawTyPath,
459-
TyObjectSum(..) => SawTyObjectSum,
459+
TyTraitObject(..) => SawTyObjectSum,
460460
TyImplTrait(..) => SawTyImplTrait,
461461
TyTypeof(..) => SawTyTypeof,
462462
TyInfer => SawTyInfer

src/librustc_passes/ast_validation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
143143
err.emit();
144144
});
145145
}
146-
TyKind::ObjectSum(ref bounds) => {
146+
TyKind::TraitObject(ref bounds) => {
147147
self.no_questions_in_bounds(bounds, "trait object types", false);
148148
}
149149
_ => {}

src/librustc_typeck/astconv.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
13471347
match path.def {
13481348
Def::Trait(trait_def_id) => {
13491349
// N.B. this case overlaps somewhat with
1350-
// TyObjectSum, see that fn for details
1350+
// TyTraitObject, see that fn for details
13511351

13521352
assert_eq!(opt_self_ty, None);
13531353
tcx.prohibit_type_params(path.segments.split_last().unwrap().1);
@@ -1525,7 +1525,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
15251525
}
15261526
tcx.mk_fn_ptr(bare_fn_ty)
15271527
}
1528-
hir::TyObjectSum(ref bounds) => {
1528+
hir::TyTraitObject(ref bounds) => {
15291529
self.conv_object_ty_poly_trait_ref(rscope, ast_ty.span, bounds)
15301530
}
15311531
hir::TyImplTrait(ref bounds) => {

src/librustdoc/clean/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1765,7 +1765,7 @@ impl Clean<Type> for hir::Ty {
17651765
trait_: box resolve_type(cx, trait_path.clean(cx), self.id)
17661766
}
17671767
}
1768-
TyObjectSum(ref bounds) => {
1768+
TyTraitObject(ref bounds) => {
17691769
let lhs_ty = bounds[0].clean(cx);
17701770
match lhs_ty {
17711771
TraitBound(poly_trait, ..) => {

src/libsyntax/ast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ pub enum TyKind {
13591359
Path(Option<QSelf>, Path),
13601360
/// A trait object type `Bound1 + Bound2 + Bound3`
13611361
/// where `Bound` is a trait or a lifetime.
1362-
ObjectSum(TyParamBounds),
1362+
TraitObject(TyParamBounds),
13631363
/// An `impl Bound1 + Bound2 + Bound3` type
13641364
/// where `Bound` is a trait or a lifetime.
13651365
ImplTrait(TyParamBounds),

src/libsyntax/fold.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@ pub fn noop_fold_ty<T: Folder>(t: P<Ty>, fld: &mut T) -> P<Ty> {
386386
TyKind::Typeof(expr) => {
387387
TyKind::Typeof(fld.fold_expr(expr))
388388
}
389-
TyKind::ObjectSum(bounds) => {
390-
TyKind::ObjectSum(bounds.move_map(|b| fld.fold_ty_param_bound(b)))
389+
TyKind::TraitObject(bounds) => {
390+
TyKind::TraitObject(bounds.move_map(|b| fld.fold_ty_param_bound(b)))
391391
}
392392
TyKind::ImplTrait(bounds) => {
393393
TyKind::ImplTrait(bounds.move_map(|b| fld.fold_ty_param_bound(b)))

src/libsyntax/parse/parser.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ impl<'a> Parser<'a> {
10451045
Some(TraitTyParamBound(poly_trait_ref, TraitBoundModifier::None)).into_iter()
10461046
.chain(other_bounds)
10471047
.collect();
1048-
Ok(ast::TyKind::ObjectSum(all_bounds))
1048+
Ok(ast::TyKind::TraitObject(all_bounds))
10491049
}
10501050
}
10511051

@@ -1327,7 +1327,7 @@ impl<'a> Parser<'a> {
13271327
}
13281328

13291329
let sp = mk_sp(lo, self.prev_span.hi);
1330-
let sum = TyKind::ObjectSum(bounds);
1330+
let sum = TyKind::TraitObject(bounds);
13311331
Ok(P(Ty {id: ast::DUMMY_NODE_ID, node: sum, span: sp}))
13321332
}
13331333

src/libsyntax/print/pprust.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ impl<'a> State<'a> {
10281028
ast::TyKind::Path(Some(ref qself), ref path) => {
10291029
self.print_qpath(path, qself, false)?
10301030
}
1031-
ast::TyKind::ObjectSum(ref bounds) => {
1031+
ast::TyKind::TraitObject(ref bounds) => {
10321032
self.print_bounds("", &bounds[..])?;
10331033
}
10341034
ast::TyKind::ImplTrait(ref bounds) => {

src/libsyntax/visit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ pub fn walk_ty<'a, V: Visitor<'a>>(visitor: &mut V, typ: &'a Ty) {
346346
visitor.visit_ty(ty);
347347
visitor.visit_expr(expression)
348348
}
349-
TyKind::ObjectSum(ref bounds) => {
349+
TyKind::TraitObject(ref bounds) => {
350350
walk_list!(visitor, visit_ty_param_bound, bounds);
351351
}
352352
TyKind::ImplTrait(ref bounds) => {

0 commit comments

Comments
 (0)