@@ -110,7 +110,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
110110 if let ExprMethodCall ( ref iter_path, _, ref iter_args ) = * iter;
111111 if iter_path. name == "iter" ;
112112 // range expression in .zip() call: 0..x.len()
113- if let Some ( higher:: Range { start: Some ( start) , end: Some ( end) , .. } ) = higher:: range( zip_arg) ;
113+ if let Some ( higher:: Range { start: Some ( start) , end: Some ( end) , .. } ) = higher:: range( cx , zip_arg) ;
114114 if is_integer_literal( start, 0 ) ;
115115 // .len() call
116116 if let ExprMethodCall ( ref len_path, _, ref len_args) = end. node;
@@ -132,7 +132,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
132132
133133 // exclusive range plus one: x..(y+1)
134134 if_chain ! {
135- if let Some ( higher:: Range { start, end: Some ( end) , limits: RangeLimits :: HalfOpen } ) = higher:: range( expr) ;
135+ if let Some ( higher:: Range { start, end: Some ( end) , limits: RangeLimits :: HalfOpen } ) = higher:: range( cx , expr) ;
136136 if let Some ( y) = y_plus_one( end) ;
137137 then {
138138 span_lint_and_then(
@@ -153,7 +153,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
153153
154154 // inclusive range minus one: x..=(y-1)
155155 if_chain ! {
156- if let Some ( higher:: Range { start, end: Some ( end) , limits: RangeLimits :: Closed } ) = higher:: range( expr) ;
156+ if let Some ( higher:: Range { start, end: Some ( end) , limits: RangeLimits :: Closed } ) = higher:: range( cx , expr) ;
157157 if let Some ( y) = y_minus_one( end) ;
158158 then {
159159 span_lint_and_then(
0 commit comments