]> git.lizzy.rs Git - rust.git/commitdiff
Fix breakage due to rust-lang/rust#58167
authorMichael Wright <mikerite@lavabit.com>
Thu, 14 Feb 2019 06:55:50 +0000 (08:55 +0200)
committerMichael Wright <mikerite@lavabit.com>
Thu, 14 Feb 2019 06:55:50 +0000 (08:55 +0200)
clippy_lints/src/cyclomatic_complexity.rs

index 6c5c5ecbb02757bf17d2a84304814e560ca14db8..76b342089bc5e1aa24a58c04135a599944b0f320 100644 (file)
@@ -94,7 +94,7 @@ fn check<'a, 'tcx: 'a>(&mut self, cx: &'a LateContext<'a, 'tcx>, body: &'tcx Bod
                 short_circuits,
                 ret_adjust,
                 span,
-                body.id().node_id,
+                body.id().hir_id,
             );
         } else {
             let mut rust_cc = cc + divergence - match_arms - short_circuits;
@@ -197,7 +197,7 @@ fn report_cc_bug(
     shorts: u64,
     returns: u64,
     span: Span,
-    _: NodeId,
+    _: HirId,
 ) {
     span_bug!(
         span,
@@ -220,9 +220,10 @@ fn report_cc_bug(
     shorts: u64,
     returns: u64,
     span: Span,
-    id: NodeId,
+    id: HirId,
 ) {
-    if !is_allowed(cx, CYCLOMATIC_COMPLEXITY, id) {
+    let node_id = cx.tcx.hir().hir_to_node_id(id);
+    if !is_allowed(cx, CYCLOMATIC_COMPLEXITY, node_id) {
         cx.sess().span_note_without_error(
             span,
             &format!(