Skip to content

Commit 32ee306

Browse files
committed
Auto merge of #3762 - mikerite:fix-build-20190214, r=flip1995
Fix breakage due to rust-lang/rust#58167
2 parents d4755e1 + 10811d5 commit 32ee306

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
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!(

clippy_lints/src/utils/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use rustc::ty::{
1717
Binder, Ty, TyCtxt,
1818
};
1919
use rustc_data_structures::sync::Lrc;
20-
use rustc_errors::{Applicability, CodeSuggestion, Substitution, SubstitutionPart};
20+
use rustc_errors::{Applicability, CodeSuggestion, Substitution, SubstitutionPart, SuggestionStyle};
2121
use std::borrow::Cow;
2222
use std::env;
2323
use std::mem;
@@ -745,7 +745,7 @@ where
745745
.collect(),
746746
}],
747747
msg: help_msg,
748-
show_code_when_inline: true,
748+
style: SuggestionStyle::ShowCode,
749749
applicability: Applicability::Unspecified,
750750
};
751751
db.suggestions.push(sugg);

0 commit comments

Comments
 (0)