diff options
| author | Michael Wright <mikerite@lavabit.com> | 2019-02-14 08:55:50 +0200 |
|---|---|---|
| committer | Michael Wright <mikerite@lavabit.com> | 2019-02-14 08:55:50 +0200 |
| commit | 533dd360d79dc06ba857e702a4362d8aa272cdd4 (patch) | |
| tree | ea420d6f1a4050a8dd5424413936b951e41b0570 | |
| parent | d4755e1f14869834242730d459b1601d961fb1c2 (diff) | |
Fix breakage due to rust-lang/rust#58167
| -rw-r--r-- | clippy_lints/src/cyclomatic_complexity.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clippy_lints/src/cyclomatic_complexity.rs b/clippy_lints/src/cyclomatic_complexity.rs index 6c5c5ecbb02..76b342089bc 100644 --- a/clippy_lints/src/cyclomatic_complexity.rs +++ b/clippy_lints/src/cyclomatic_complexity.rs @@ -94,7 +94,7 @@ impl CyclomaticComplexity { 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!( |
