Rename ObjectSum into TraitObject in AST/HIR
This commit is contained in:
parent
869b81646d
commit
66ef5f2bb5
13 changed files with 17 additions and 17 deletions
|
@ -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) => {
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
_ => {}
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -1765,7 +1765,7 @@ impl Clean<Type> 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, ..) => {
|
||||
|
|
|
@ -1359,7 +1359,7 @@ pub enum TyKind {
|
|||
Path(Option<QSelf>, 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),
|
||||
|
|
|
@ -386,8 +386,8 @@ pub fn noop_fold_ty<T: Folder>(t: P<Ty>, fld: &mut T) -> P<Ty> {
|
|||
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)))
|
||||
|
|
|
@ -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}))
|
||||
}
|
||||
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue