]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/matches.rs
Merge pull request #2813 from terry90/master
[rust.git] / clippy_lints / src / matches.rs
index be68e9b1a2f003a51a60d3fe86b631144638abbf..8ab0482bacfdba2bb87bd2f46c6f78b28f0f8415 100644 (file)
@@ -5,11 +5,11 @@
 use std::collections::Bound;
 use syntax::ast::LitKind;
 use syntax::codemap::Span;
-use utils::paths;
-use utils::{expr_block, in_external_macro, is_allowed, is_expn_of, match_qpath, match_type, multispan_sugg,
+use crate::utils::paths;
+use crate::utils::{expr_block, in_external_macro, is_allowed, is_expn_of, match_qpath, match_type, multispan_sugg,
             remove_blocks, snippet, span_lint_and_sugg, span_lint_and_then, span_note_and_lint, walk_ptrs_ty};
-use utils::sugg::Sugg;
-use consts::{constant, Constant};
+use crate::utils::sugg::Sugg;
+use crate::consts::{constant, Constant};
 
 /// **What it does:** Checks for matches with a single arm where an `if let`
 /// will usually suffice.
@@ -470,8 +470,8 @@ fn all_ranges<'a, 'tcx>(
                 [].iter()
             }.filter_map(|pat| {
                 if let PatKind::Range(ref lhs, ref rhs, ref range_end) = pat.node {
-                    let lhs = constant(cx, lhs)?.0;
-                    let rhs = constant(cx, rhs)?.0;
+                    let lhs = constant(cx, cx.tables, lhs)?.0;
+                    let rhs = constant(cx, cx.tables, rhs)?.0;
                     let rhs = match *range_end {
                         RangeEnd::Included => Bound::Included(rhs),
                         RangeEnd::Excluded => Bound::Excluded(rhs),
@@ -480,7 +480,7 @@ fn all_ranges<'a, 'tcx>(
                 }
 
                 if let PatKind::Lit(ref value) = pat.node {
-                    let value = constant(cx, value)?.0;
+                    let value = constant(cx, cx.tables, value)?.0;
                     return Some(SpannedRange { span: pat.span, node: (value.clone(), Bound::Included(value)) });
                 }