]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #3762 - mikerite:fix-build-20190214, r=flip1995
authorbors <bors@rust-lang.org>
Thu, 14 Feb 2019 13:17:48 +0000 (13:17 +0000)
committerbors <bors@rust-lang.org>
Thu, 14 Feb 2019 13:17:48 +0000 (13:17 +0000)
Fix breakage due to rust-lang/rust#58167

clippy_lints/src/cyclomatic_complexity.rs
clippy_lints/src/utils/mod.rs

index 6c5c5ecbb02757bf17d2a84304814e560ca14db8..76b342089bc5e1aa24a58c04135a599944b0f320 100644 (file)
@@ -94,7 +94,7 @@ fn check<'a, 'tcx: 'a>(&mut self, cx: &'a LateContext<'a, 'tcx>, body: &'tcx Bod
                 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!(
index b5221bca0073f73d42aa4625e53380cbf66809c7..0816c209a42db61aaa32e630c2cd78ae351c0422 100644 (file)
@@ -17,7 +17,7 @@
     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;
@@ -745,7 +745,7 @@ pub fn multispan_sugg<I>(db: &mut DiagnosticBuilder<'_>, help_msg: String, sugg:
                 .collect(),
         }],
         msg: help_msg,
-        show_code_when_inline: true,
+        style: SuggestionStyle::ShowCode,
         applicability: Applicability::Unspecified,
     };
     db.suggestions.push(sugg);