We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d4755e1 commit 533dd36Copy full SHA for 533dd36
clippy_lints/src/cyclomatic_complexity.rs
@@ -94,7 +94,7 @@ impl CyclomaticComplexity {
94
short_circuits,
95
ret_adjust,
96
span,
97
- body.id().node_id,
+ body.id().hir_id,
98
);
99
} else {
100
let mut rust_cc = cc + divergence - match_arms - short_circuits;
@@ -197,7 +197,7 @@ fn report_cc_bug(
197
shorts: u64,
198
returns: u64,
199
span: Span,
200
- _: NodeId,
+ _: HirId,
201
) {
202
span_bug!(
203
@@ -220,9 +220,10 @@ fn report_cc_bug(
220
221
222
223
- id: NodeId,
+ id: HirId,
224
225
- if !is_allowed(cx, CYCLOMATIC_COMPLEXITY, id) {
+ let node_id = cx.tcx.hir().hir_to_node_id(id);
226
+ if !is_allowed(cx, CYCLOMATIC_COMPLEXITY, node_id) {
227
cx.sess().span_note_without_error(
228
229
&format!(
0 commit comments