Move more functions to utils::higher

This commit is contained in:
mcarton 2016-06-30 00:08:43 +02:00
parent 92b04129fe
commit 4dff4df577
No known key found for this signature in database
GPG key ID: 5E427C794CBA45E8
8 changed files with 46 additions and 47 deletions

View file

@ -3,7 +3,7 @@ use rustc::ty::TypeVariants;
use rustc::hir::*;
use syntax::codemap::Span;
use syntax::ptr::P;
use utils::{is_expn_of, match_path, paths, recover_for_loop, snippet, span_lint_and_then};
use utils::{higher, is_expn_of, match_path, paths, snippet, span_lint_and_then};
/// **What it does:** This lint warns about using `&vec![..]` when using `&[..]` would be possible.
///
@ -42,7 +42,7 @@ impl LateLintPass for Pass {
}}
// search for `for _ in vec![…]`
if let Some((_, arg, _)) = recover_for_loop(expr) {
if let Some((_, arg, _)) = higher::for_loop(expr) {
// report the error around the `vec!` not inside `<std macros>:`
let span = cx.sess().codemap().source_callsite(arg.span);
check_vec_macro(cx, arg, span);