Skip to content

Commit 533dd36

Browse files
author
Michael Wright
committed
Fix breakage due to rust-lang/rust#58167
1 parent d4755e1 commit 533dd36

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

clippy_lints/src/cyclomatic_complexity.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl CyclomaticComplexity {
9494
short_circuits,
9595
ret_adjust,
9696
span,
97-
body.id().node_id,
97+
body.id().hir_id,
9898
);
9999
} else {
100100
let mut rust_cc = cc + divergence - match_arms - short_circuits;
@@ -197,7 +197,7 @@ fn report_cc_bug(
197197
shorts: u64,
198198
returns: u64,
199199
span: Span,
200-
_: NodeId,
200+
_: HirId,
201201
) {
202202
span_bug!(
203203
span,
@@ -220,9 +220,10 @@ fn report_cc_bug(
220220
shorts: u64,
221221
returns: u64,
222222
span: Span,
223-
id: NodeId,
223+
id: HirId,
224224
) {
225-
if !is_allowed(cx, CYCLOMATIC_COMPLEXITY, id) {
225+
let node_id = cx.tcx.hir().hir_to_node_id(id);
226+
if !is_allowed(cx, CYCLOMATIC_COMPLEXITY, node_id) {
226227
cx.sess().span_note_without_error(
227228
span,
228229
&format!(

0 commit comments

Comments
 (0)