]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/regionck.rs
Add some type-alias-impl-trait regression tests
[rust.git] / src / librustc_typeck / check / regionck.rs
index 90d8d0623a75b1aa4af4ce4a04bdc9f5eef4dfcd..967741092febe41b6b277a382d2bd506e0739a86 100644 (file)
 use crate::check::FnCtxt;
 use crate::mem_categorization as mc;
 use crate::middle::region;
-use rustc::hir::def_id::DefId;
+use rustc::hir::map::Map;
 use rustc::infer::outlives::env::OutlivesEnvironment;
 use rustc::infer::{self, RegionObligation, SuppressRegionErrors};
 use rustc::ty::adjustment;
 use rustc::ty::subst::{GenericArgKind, SubstsRef};
 use rustc::ty::{self, Ty};
-
-use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor};
-use rustc::hir::{self, PatKind};
+use rustc_hir as hir;
+use rustc_hir::def_id::DefId;
+use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
+use rustc_hir::PatKind;
 use rustc_span::Span;
 use std::mem;
 use std::ops::Deref;
@@ -414,7 +415,9 @@ impl<'a, 'tcx> Visitor<'tcx> for RegionCtxt<'a, 'tcx> {
     // hierarchy, and in particular the relationships between free
     // regions, until regionck, as described in #3238.
 
-    fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
+    type Map = Map<'tcx>;
+
+    fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
         NestedVisitorMap::None
     }
 
@@ -492,7 +495,7 @@ fn visit_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) {
         if is_method_call {
             let origin = match expr.kind {
                 hir::ExprKind::MethodCall(..) => infer::ParameterOrigin::MethodCall,
-                hir::ExprKind::Unary(op, _) if op == hir::UnDeref => {
+                hir::ExprKind::Unary(op, _) if op == hir::UnOp::UnDeref => {
                     infer::ParameterOrigin::OverloadedDeref
                 }
                 _ => infer::ParameterOrigin::OverloadedOperator,
@@ -577,7 +580,7 @@ fn visit_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) {
                 intravisit::walk_expr(self, expr);
             }
 
-            hir::ExprKind::Unary(hir::UnDeref, ref base) => {
+            hir::ExprKind::Unary(hir::UnOp::UnDeref, ref base) => {
                 // For *a, the lifetime of a must enclose the deref
                 if is_method_call {
                     self.constrain_call(expr, Some(base), None::<hir::Expr<'_>>.iter());