mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
add the path to the util::path module
This commit is contained in:
parent
319c66a2a4
commit
fc54a91916
@ -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;
|
||||
|
@ -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"];
|
||||
|
Loading…
Reference in New Issue
Block a user