diff --git a/clippy_lints/src/array_indexing.rs b/clippy_lints/src/array_indexing.rs
index 4563a58f7abd..1b21cf8c5ff4 100644
--- a/clippy_lints/src/array_indexing.rs
+++ b/clippy_lints/src/array_indexing.rs
@@ -3,6 +3,7 @@ use rustc::ty;
use rustc::hir;
use syntax::ast::RangeLimits;
use utils::{self, higher};
+use utils::higher::Range;
use consts::{constant, Constant};
/// **What it does:** Checks for out of bounds array indexing with a constant
@@ -73,10 +74,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ArrayIndexing {
// Index is a constant range
if let Some(range) = higher::range(index) {
- let start = range.start.map(|start| constant(cx, start).map(|(c, _)| c));
- let end = range.end.map(|end| constant(cx, end).map(|(c, _)| c));
-
- if let Some((start, end)) = to_const_range(&start, &end, range.limits, size) {
+ if let Some((start, end)) = to_const_range(cx, range, size) {
if start > size || end > size {
utils::span_lint(cx, OUT_OF_BOUNDS_INDEXING, e.span, "range is out of bounds");
}
@@ -102,20 +100,17 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ArrayIndexing {
/// Returns an option containing a tuple with the start and end (exclusive) of
/// the range.
-fn to_const_range(
- start: &Option