diff --git a/src/librustc/hir/intravisit.rs b/src/librustc/hir/intravisit.rs index 4b171193b4af..c244c33728c7 100644 --- a/src/librustc/hir/intravisit.rs +++ b/src/librustc/hir/intravisit.rs @@ -740,12 +740,12 @@ pub fn walk_where_predicate<'v, V: Visitor<'v>>( walk_list!(visitor, visit_lifetime, bounds); } &WherePredicate::EqPredicate(WhereEqPredicate{id, - ref path, - ref ty, + ref lhs_ty, + ref rhs_ty, ..}) => { visitor.visit_id(id); - visitor.visit_path(path, id); - visitor.visit_ty(ty); + visitor.visit_ty(lhs_ty); + visitor.visit_ty(rhs_ty); } } } diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 9a2658f48f3d..bdd54c547e3e 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -719,13 +719,13 @@ impl<'a> LoweringContext<'a> { }) } WherePredicate::EqPredicate(WhereEqPredicate{ id, - ref path, - ref ty, + ref lhs_ty, + ref rhs_ty, span}) => { hir::WherePredicate::EqPredicate(hir::WhereEqPredicate { id: id, - path: self.lower_path(id, path, ParamMode::Explicit, false), - ty: self.lower_ty(ty), + lhs_ty: self.lower_ty(lhs_ty), + rhs_ty: self.lower_ty(rhs_ty), span: span, }) } diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 9149da459c26..075358c576ce 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -403,8 +403,8 @@ pub struct WhereRegionPredicate { pub struct WhereEqPredicate { pub id: NodeId, pub span: Span, - pub path: Path, - pub ty: P, + pub lhs_ty: P, + pub rhs_ty: P, } pub type CrateConfig = HirVec>; diff --git a/src/librustc/hir/print.rs b/src/librustc/hir/print.rs index c06c53810d75..b84a33083156 100644 --- a/src/librustc/hir/print.rs +++ b/src/librustc/hir/print.rs @@ -2023,11 +2023,13 @@ impl<'a> State<'a> { } } } - &hir::WherePredicate::EqPredicate(hir::WhereEqPredicate{ref path, ref ty, ..}) => { - self.print_path(path, false)?; + &hir::WherePredicate::EqPredicate(hir::WhereEqPredicate{ref lhs_ty, + ref rhs_ty, + ..}) => { + self.print_type(lhs_ty)?; space(&mut self.s)?; self.word_space("=")?; - self.print_type(&ty)?; + self.print_type(rhs_ty)?; } } } diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index c491af972acb..dd99aea909fa 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -323,12 +323,11 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { self.visit_lifetime(bound); } } - &hir::WherePredicate::EqPredicate(hir::WhereEqPredicate{ id, - ref path, - ref ty, - .. }) => { - self.visit_path(path, id); - self.visit_ty(&ty); + &hir::WherePredicate::EqPredicate(hir::WhereEqPredicate{ref lhs_ty, + ref rhs_ty, + .. }) => { + self.visit_ty(lhs_ty); + self.visit_ty(rhs_ty); } } } diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index ef7a1f695ffb..ff4c92bb40ef 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -853,7 +853,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> { } &hir::WherePredicate::RegionPredicate(_) => {} &hir::WherePredicate::EqPredicate(ref eq_pred) => { - self.visit_ty(&eq_pred.ty); + self.visit_ty(&eq_pred.rhs_ty); } } } diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 709de49fbaaf..52f9ec30aec0 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -403,8 +403,8 @@ pub struct WhereRegionPredicate { pub struct WhereEqPredicate { pub id: NodeId, pub span: Span, - pub path: Path, - pub ty: P, + pub lhs_ty: P, + pub rhs_ty: P, } /// The set of MetaItems that define the compilation environment of the crate, diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 10ca9da2112c..1d9abebc7b81 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -766,13 +766,13 @@ pub fn noop_fold_where_predicate( }) } ast::WherePredicate::EqPredicate(ast::WhereEqPredicate{id, - path, - ty, + lhs_ty, + rhs_ty, span}) => { ast::WherePredicate::EqPredicate(ast::WhereEqPredicate{ id: fld.new_id(id), - path: fld.fold_path(path), - ty:fld.fold_ty(ty), + lhs_ty: fld.fold_ty(lhs_ty), + rhs_ty: fld.fold_ty(rhs_ty), span: fld.new_span(span) }) } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index ff77732f5354..f6ed2350105a 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2849,11 +2849,13 @@ impl<'a> State<'a> { ..}) => { self.print_lifetime_bounds(lifetime, bounds)?; } - ast::WherePredicate::EqPredicate(ast::WhereEqPredicate{ref path, ref ty, ..}) => { - self.print_path(path, false, 0, false)?; + ast::WherePredicate::EqPredicate(ast::WhereEqPredicate{ref lhs_ty, + ref rhs_ty, + ..}) => { + self.print_type(lhs_ty)?; space(&mut self.s)?; self.word_space("=")?; - self.print_type(&ty)?; + self.print_type(rhs_ty)?; } } } diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 04100b3af001..cc6ba7adf1a6 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -508,12 +508,11 @@ pub fn walk_generics<'a, V: Visitor<'a>>(visitor: &mut V, generics: &'a Generics visitor.visit_lifetime(lifetime); walk_list!(visitor, visit_lifetime, bounds); } - WherePredicate::EqPredicate(WhereEqPredicate{id, - ref path, - ref ty, + WherePredicate::EqPredicate(WhereEqPredicate{ref lhs_ty, + ref rhs_ty, ..}) => { - visitor.visit_path(path, id); - visitor.visit_ty(ty); + visitor.visit_ty(lhs_ty); + visitor.visit_ty(rhs_ty); } } } diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index 1f50ceb626c7..b99b10193681 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -558,8 +558,8 @@ impl<'a> TraitDef<'a> { ast::WherePredicate::EqPredicate(ast::WhereEqPredicate { id: ast::DUMMY_NODE_ID, span: self.span, - path: we.path.clone(), - ty: we.ty.clone(), + lhs_ty: we.lhs_ty.clone(), + rhs_ty: we.rhs_ty.clone(), }) } }