about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2017-01-16 21:32:13 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2017-01-16 21:32:13 +0300
commit828404684b486a2b741858970a150530228258bb (patch)
treebf660842e2b28774050f50348d5be2b627855fef
parent47410b23aa85255ae2dc021498a2e54806f4bb0a (diff)
AST/HIR: Replace Path with Type in WhereEqPredicate
-rw-r--r--src/librustc/hir/intravisit.rs8
-rw-r--r--src/librustc/hir/lowering.rs8
-rw-r--r--src/librustc/hir/mod.rs4
-rw-r--r--src/librustc/hir/print.rs8
-rw-r--r--src/librustc/middle/resolve_lifetime.rs11
-rw-r--r--src/librustc_privacy/lib.rs2
-rw-r--r--src/libsyntax/ast.rs4
-rw-r--r--src/libsyntax/fold.rs8
-rw-r--r--src/libsyntax/print/pprust.rs8
-rw-r--r--src/libsyntax/visit.rs9
-rw-r--r--src/libsyntax_ext/deriving/generic/mod.rs4
11 files changed, 38 insertions, 36 deletions
diff --git a/src/librustc/hir/intravisit.rs b/src/librustc/hir/intravisit.rs
index 4b171193b4a..c244c33728c 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 9a2658f48f3..bdd54c547e3 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 9149da459c2..075358c576c 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<Ty>,
+    pub lhs_ty: P<Ty>,
+    pub rhs_ty: P<Ty>,
 }
 
 pub type CrateConfig = HirVec<P<MetaItem>>;
diff --git a/src/librustc/hir/print.rs b/src/librustc/hir/print.rs
index c06c53810d7..b84a3308315 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 c491af972ac..dd99aea909f 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 ef7a1f695ff..ff4c92bb40e 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 709de49fbaa..52f9ec30aec 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<Ty>,
+    pub lhs_ty: P<Ty>,
+    pub rhs_ty: P<Ty>,
 }
 
 /// 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 10ca9da2112..1d9abebc7b8 100644
--- a/src/libsyntax/fold.rs
+++ b/src/libsyntax/fold.rs
@@ -766,13 +766,13 @@ pub fn noop_fold_where_predicate<T: Folder>(
             })
         }
         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 ff77732f535..f6ed2350105 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 04100b3af00..cc6ba7adf1a 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 1f50ceb626c..b99b1019368 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(),
                     })
                 }
             }