+ pub fn match_def_path(&self, def_id: DefId, path: &[&str]) -> bool {
+ let names = self.get_def_path(def_id);
+
+ names.len() == path.len() && names.into_iter().zip(path.iter()).all(|(a, &b)| *a == *b)
+ }
+
+ /// Gets the absolute path of `def_id` as a vector of `&str`.
+ ///
+ /// # Examples
+ /// ```rust,ignore (no `cx` or `def_id` available)
+ /// let def_path = cx.get_def_path(def_id);
+ /// if let &["core", "option", "Option"] = &def_path[..] {
+ /// // The given `def_id` is that of an `Option` type
+ /// }
+ /// ```
+ // Uplifted from rust-lang/rust-clippy
+ pub fn get_def_path(&self, def_id: DefId) -> Vec<LocalInternedString> {