Skip to content

Commit

Permalink
Auto merge of #3762 - mikerite:fix-build-20190214, r=flip1995
Browse files Browse the repository at this point in the history
Fix breakage due to rust-lang/rust#58167
  • Loading branch information
bors committed Feb 14, 2019
2 parents d4755e1 + 10811d5 commit 32ee306
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions clippy_lints/src/cyclomatic_complexity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -197,7 +197,7 @@ fn report_cc_bug(
shorts: u64,
returns: u64,
span: Span,
_: NodeId,
_: HirId,
) {
span_bug!(
span,
Expand All @@ -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!(
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use rustc::ty::{
Binder, Ty, TyCtxt,
};
use rustc_data_structures::sync::Lrc;
use rustc_errors::{Applicability, CodeSuggestion, Substitution, SubstitutionPart};
use rustc_errors::{Applicability, CodeSuggestion, Substitution, SubstitutionPart, SuggestionStyle};
use std::borrow::Cow;
use std::env;
use std::mem;
Expand Down Expand Up @@ -745,7 +745,7 @@ where
.collect(),
}],
msg: help_msg,
show_code_when_inline: true,
style: SuggestionStyle::ShowCode,
applicability: Applicability::Unspecified,
};
db.suggestions.push(sugg);
Expand Down

0 comments on commit 32ee306

Please sign in to comment.