@@ -757,12 +757,12 @@ impl<'a, 'tcx> LateContext<'a, 'tcx> {
757
757
/// Check if a `DefId`'s path matches the given absolute type path usage.
758
758
///
759
759
/// # Examples
760
- /// ```rust,ignore (no `cx` or `def_id` available)
760
+ ///
761
+ /// ```rust,ignore (no context or def id available)
761
762
/// if cx.match_def_path(def_id, &["core", "option", "Option"]) {
762
763
/// // The given `def_id` is that of an `Option` type
763
764
/// }
764
765
/// ```
765
- // Uplifted from rust-lang/rust-clippy
766
766
pub fn match_def_path ( & self , def_id : DefId , path : & [ & str ] ) -> bool {
767
767
let names = self . get_def_path ( def_id) ;
768
768
@@ -772,13 +772,13 @@ impl<'a, 'tcx> LateContext<'a, 'tcx> {
772
772
/// Gets the absolute path of `def_id` as a vector of `&str`.
773
773
///
774
774
/// # Examples
775
- /// ```rust,ignore (no `cx` or `def_id` available)
775
+ ///
776
+ /// ```rust,ignore (no context or def id available)
776
777
/// let def_path = cx.get_def_path(def_id);
777
778
/// if let &["core", "option", "Option"] = &def_path[..] {
778
779
/// // The given `def_id` is that of an `Option` type
779
780
/// }
780
781
/// ```
781
- // Uplifted from rust-lang/rust-clippy
782
782
pub fn get_def_path ( & self , def_id : DefId ) -> Vec < LocalInternedString > {
783
783
pub struct AbsolutePathPrinter < ' a , ' tcx > {
784
784
pub tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
0 commit comments