]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/lints.rs
Auto merge of #61587 - alexcrichton:distcheck-no-assertions, r=pietroalbini
[rust.git] / src / librustc_mir / lints.rs
index cbfc89934718600c9337c4b40e0b81fab9bc4a6b..e15c8a4b416643c1b807705fe60902e4cf4ee4df 100644 (file)
@@ -8,18 +8,18 @@
 use rustc::ty::subst::InternalSubsts;
 
 pub fn check(tcx: TyCtxt<'a, 'tcx, 'tcx>,
-             mir: &Body<'tcx>,
+             body: &Body<'tcx>,
              def_id: DefId) {
     let hir_id = tcx.hir().as_local_hir_id(def_id).unwrap();
 
     if let Some(fn_like_node) = FnLikeNode::from_node(tcx.hir().get_by_hir_id(hir_id)) {
-        check_fn_for_unconditional_recursion(tcx, fn_like_node.kind(), mir, def_id);
+        check_fn_for_unconditional_recursion(tcx, fn_like_node.kind(), body, def_id);
     }
 }
 
 fn check_fn_for_unconditional_recursion(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                                         fn_kind: FnKind<'_>,
-                                        mir: &Body<'tcx>,
+                                        body: &Body<'tcx>,
                                         def_id: DefId) {
     if let FnKind::Closure(_) = fn_kind {
         // closures can't recur, so they don't matter.
@@ -54,7 +54,7 @@ fn check_fn_for_unconditional_recursion(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     // to have behaviour like the above, rather than
     // e.g., accidentally recursing after an assert.
 
-    let basic_blocks = mir.basic_blocks();
+    let basic_blocks = body.basic_blocks();
     let mut reachable_without_self_call_queue = vec![mir::START_BLOCK];
     let mut reached_exit_without_self_call = false;
     let mut self_call_locations = vec![];
@@ -84,7 +84,7 @@ fn check_fn_for_unconditional_recursion(tcx: TyCtxt<'a, 'tcx, 'tcx>,
         if let Some(ref terminator) = block.terminator {
             match terminator.kind {
                 TerminatorKind::Call { ref func, .. } => {
-                    let func_ty = func.ty(mir, tcx);
+                    let func_ty = func.ty(body, tcx);
 
                     if let ty::FnDef(fn_def_id, substs) = func_ty.sty {
                         let (call_fn_id, call_substs) =