File tree 1 file changed +1
-25
lines changed
1 file changed +1
-25
lines changed Original file line number Diff line number Diff line change 4
4
//! overview of how lints are implemented.
5
5
6
6
use std:: cell:: Cell ;
7
- use std:: { iter , slice} ;
7
+ use std:: slice;
8
8
9
9
use rustc_data_structures:: fx:: FxIndexMap ;
10
10
use rustc_data_structures:: sync;
@@ -718,30 +718,6 @@ impl<'tcx> LateContext<'tcx> {
718
718
}
719
719
}
720
720
721
- /// Check if a `DefId`'s path matches the given absolute type path usage.
722
- ///
723
- /// Anonymous scopes such as `extern` imports are matched with `kw::Empty`;
724
- /// inherent `impl` blocks are matched with the name of the type.
725
- ///
726
- /// Instead of using this method, it is often preferable to instead use
727
- /// `rustc_diagnostic_item` or a `lang_item`. This is less prone to errors
728
- /// as paths get invalidated if the target definition moves.
729
- ///
730
- /// # Examples
731
- ///
732
- /// ```rust,ignore (no context or def id available)
733
- /// if cx.match_def_path(def_id, &[sym::core, sym::option, sym::Option]) {
734
- /// // The given `def_id` is that of an `Option` type
735
- /// }
736
- /// ```
737
- ///
738
- /// Used by clippy, but should be replaced by diagnostic items eventually.
739
- pub fn match_def_path ( & self , def_id : DefId , path : & [ Symbol ] ) -> bool {
740
- let names = self . get_def_path ( def_id) ;
741
-
742
- names. len ( ) == path. len ( ) && iter:: zip ( names, path) . all ( |( a, & b) | a == b)
743
- }
744
-
745
721
/// Gets the absolute path of `def_id` as a vector of `Symbol`.
746
722
///
747
723
/// # Examples
You can’t perform that action at this time.
0 commit comments