add the path to the util::path module

This commit is contained in:
Oliver Schneider 2016-07-15 18:10:28 +02:00
parent 319c66a2a4
commit fc54a91916
No known key found for this signature in database
GPG Key ID: 56D6EEA0FC67AC46
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,6 @@
use rustc::lint::*;
use rustc::hir::*;
use utils::{span_lint, get_trait_def_id};
use utils::{span_lint, get_trait_def_id, paths};
/// **What it does:** This lint checks for mis-uses of the serde API
///
@ -28,7 +28,7 @@ impl LateLintPass for Serde {
fn check_item(&mut self, cx: &LateContext, item: &Item) {
if let ItemImpl(_, _, _, Some(ref trait_ref), _, ref items) = item.node {
let did = cx.tcx.expect_def(trait_ref.ref_id).def_id();
if let Some(visit_did) = get_trait_def_id(cx, &["serde", "de", "Visitor"]) {
if let Some(visit_did) = get_trait_def_id(cx, &paths::SERDE_DE_VISITOR) {
if did == visit_did {
let mut seen_str = None;
let mut seen_string = None;

View File

@ -55,6 +55,7 @@ pub const REGEX_NEW: [&'static str; 4] = ["regex", "re_unicode", "Regex", "new"]
pub const REGEX_SET_NEW: [&'static str; 5] = ["regex", "re_set", "unicode", "RegexSet", "new"];
pub const RESULT: [&'static str; 3] = ["core", "result", "Result"];
pub const STRING: [&'static str; 3] = ["collections", "string", "String"];
pub const SERDE_DE_VISITOR: [&'static str; 3] = ["serde", "de", "Visitor"];
pub const TRANSMUTE: [&'static str; 4] = ["core", "intrinsics", "", "transmute"];
pub const VEC: [&'static str; 3] = ["collections", "vec", "Vec"];
pub const VEC_DEQUE: [&'static str; 3] = ["collections", "vec_deque", "VecDeque"];