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.
[].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),
}
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)) });
}