From f46e96405fe990ab15d51a8ee54d349f7e79e3b0 Mon Sep 17 00:00:00 2001 From: mcarton Date: Sun, 3 Apr 2016 17:16:53 +0200 Subject: [PATCH] Rustup to 1.9.0-nightly (5ab11d72c 2016-04-02) --- src/cyclomatic_complexity.rs | 16 ++++++++-------- src/escape.rs | 2 +- src/matches.rs | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/cyclomatic_complexity.rs b/src/cyclomatic_complexity.rs index 3db080f970ef..ca5acc6895fa 100644 --- a/src/cyclomatic_complexity.rs +++ b/src/cyclomatic_complexity.rs @@ -149,14 +149,14 @@ impl<'a, 'b, 'tcx> Visitor<'a> for CCHelper<'b, 'tcx> { } #[cfg(feature="debugging")] -fn report_cc_bug(cx: &LateContext, cc: u64, narms: u64, div: u64, shorts: u64, span: Span) { - cx.sess().span_bug(span, - &format!("Clippy encountered a bug calculating cyclomatic complexity: cc = {}, arms = {}, \ - div = {}, shorts = {}. Please file a bug report.", - cc, - narms, - div, - shorts));; +fn report_cc_bug(_: &LateContext, cc: u64, narms: u64, div: u64, shorts: u64, span: Span) { + span_bug!(span, + "Clippy encountered a bug calculating cyclomatic complexity: cc = {}, arms = {}, \ + div = {}, shorts = {}. Please file a bug report.", + cc, + narms, + div, + shorts); } #[cfg(not(feature="debugging"))] fn report_cc_bug(cx: &LateContext, cc: u64, narms: u64, div: u64, shorts: u64, span: Span) { diff --git a/src/escape.rs b/src/escape.rs index 51c4c7b6f5df..98500bf62f01 100644 --- a/src/escape.rs +++ b/src/escape.rs @@ -144,7 +144,7 @@ impl<'a, 'tcx: 'a> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> { self.set.remove(&lid); // Used without autodereffing (i.e. x.clone()) } } else { - self.cx.sess().span_bug(cmt.span, "Unknown adjusted AutoRef"); + span_bug!(cmt.span, "Unknown adjusted AutoRef"); } } else if LoanCause::AddrOf == loan_cause { // &x diff --git a/src/matches.rs b/src/matches.rs index 40013209e57a..f1499f7fb94f 100644 --- a/src/matches.rs +++ b/src/matches.rs @@ -415,8 +415,8 @@ fn match_template(cx: &LateContext, span: Span, source: MatchSource, op: &str, e MatchSource::Normal => format!("match {}{} {{ .. }}", op, expr_snippet), MatchSource::IfLetDesugar { .. } => format!("if let .. = {}{} {{ .. }}", op, expr_snippet), MatchSource::WhileLetDesugar => format!("while let .. = {}{} {{ .. }}", op, expr_snippet), - MatchSource::ForLoopDesugar => cx.sess().span_bug(span, "for loop desugared to match with &-patterns!"), - MatchSource::TryDesugar => cx.sess().span_bug(span, "`?` operator desugared to match with &-patterns!") + MatchSource::ForLoopDesugar => span_bug!(span, "for loop desugared to match with &-patterns!"), + MatchSource::TryDesugar => span_bug!(span, "`?` operator desugared to match with &-patterns!") } }