about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCameron Steffen <cam.steffen94@gmail.com>2021-04-06 08:56:14 -0500
committerCameron Steffen <cam.steffen94@gmail.com>2021-04-06 11:46:27 -0500
commita342de3bcb405c1be191e906d813feb4b4be2fbf (patch)
tree893b7eac59e4be1a89a649d5d1b1b7b02e83b2c3
parent6ae0835df01f51c75b516b02ab2983576cf6b0b3 (diff)
downloadrust-a342de3bcb405c1be191e906d813feb4b4be2fbf.tar.gz
rust-a342de3bcb405c1be191e906d813feb4b4be2fbf.zip
Soft deprecate match_path and match_qpath
-rw-r--r--clippy_utils/src/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs
index 7ce90ffd9f0..4e6e0e2b9a9 100644
--- a/clippy_utils/src/lib.rs
+++ b/clippy_utils/src/lib.rs
@@ -349,6 +349,10 @@ pub fn single_segment_path<'tcx>(path: &QPath<'tcx>) -> Option<&'tcx PathSegment
     }
 }
 
+/// THIS METHOD IS DEPRECATED and will eventually be removed since it does not match against the
+/// entire path or resolved `DefId`. Prefer using `match_def_path`. Consider getting a `DefId` from
+/// `QPath::Resolved.1.res.opt_def_id()`.
+///
 /// Matches a `QPath` against a slice of segment string literals.
 ///
 /// There is also `match_path` if you are dealing with a `rustc_hir::Path` instead of a
@@ -376,6 +380,10 @@ pub fn match_qpath(path: &QPath<'_>, segments: &[&str]) -> bool {
     }
 }
 
+/// THIS METHOD IS DEPRECATED and will eventually be removed since it does not match against the
+/// entire path or resolved `DefId`. Prefer using `match_def_path`. Consider getting a `DefId` from
+/// `QPath::Resolved.1.res.opt_def_id()`.
+///
 /// Matches a `Path` against a slice of segment string literals.
 ///
 /// There is also `match_qpath` if you are dealing with a `rustc_hir::QPath` instead of a