]> git.lizzy.rs Git - rust.git/commitdiff
fix markdown syntax in `LateContext` examples
authorAndy Russell <arussell123@gmail.com>
Thu, 2 May 2019 16:33:59 +0000 (12:33 -0400)
committerAndy Russell <arussell123@gmail.com>
Thu, 2 May 2019 19:52:27 +0000 (15:52 -0400)
src/librustc/lint/context.rs

index 8d5c1798e0fa4a5c0ef82d076419d45fb351795c..e713cf8d805531669f4d6a4759d046986e0240f2 100644 (file)
@@ -757,12 +757,12 @@ pub fn current_lint_root(&self) -> hir::HirId {
     /// Check if a `DefId`'s path matches the given absolute type path usage.
     ///
     /// # Examples
-    /// ```rust,ignore (no `cx` or `def_id` available)
+    ///
+    /// ```rust,ignore (no context or def id available)
     /// if cx.match_def_path(def_id, &["core", "option", "Option"]) {
     ///     // The given `def_id` is that of an `Option` type
     /// }
     /// ```
-    // Uplifted from rust-lang/rust-clippy
     pub fn match_def_path(&self, def_id: DefId, path: &[&str]) -> bool {
         let names = self.get_def_path(def_id);
 
@@ -772,13 +772,13 @@ pub fn match_def_path(&self, def_id: DefId, path: &[&str]) -> bool {
     /// Gets the absolute path of `def_id` as a vector of `&str`.
     ///
     /// # Examples
-    /// ```rust,ignore (no `cx` or `def_id` available)
+    ///
+    /// ```rust,ignore (no context 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> {
         pub struct AbsolutePathPrinter<'a, 'tcx> {
             pub tcx: TyCtxt<'a, 'tcx, 'tcx>,