Doctests: Fix all complexity lint docs

cc #4319
This commit is contained in:
Philipp Hansch 2019-08-02 08:13:54 +02:00
parent 18a7dce4da
commit abfa8a952c
No known key found for this signature in database
GPG key ID: 82AA61CAA11397E6
33 changed files with 155 additions and 83 deletions

View file

@ -15,7 +15,7 @@ declare_clippy_lint! {
/// **What it does:** Generates clippy code that detects the offending pattern
///
/// **Example:**
/// ```rust
/// ```rust,ignore
/// // ./tests/ui/my_lint.rs
/// fn foo() {
/// // detect the following pattern
@ -24,13 +24,14 @@ declare_clippy_lint! {
/// // but ignore everything from here on
/// #![clippy::author = "ignore"]
/// }
/// ()
/// }
/// ```
///
/// Running `TESTNAME=ui/my_lint cargo uitest` will produce
/// a `./tests/ui/new_lint.stdout` file with the generated code:
///
/// ```rust
/// ```rust,ignore
/// // ./tests/ui/new_lint.stdout
/// if_chain! {
/// if let ExprKind::If(ref cond, ref then, None) = item.node,

View file

@ -13,14 +13,14 @@ declare_clippy_lint! {
/// attribute
///
/// **Example:**
/// ```rust
/// ```rust,ignore
/// #[clippy::dump]
/// extern crate foo;
/// ```
///
/// prints
///
/// ```
/// ```text
/// item `foo`
/// visibility inherited from outer item
/// extern crate dylib source: "/path/to/foo.so"

View file

@ -38,7 +38,7 @@ declare_clippy_lint! {
/// `declare_lint_pass!`, `impl_lint_pass!`, and `lint_array!` macros.
///
/// **Example:**
/// ```rust
/// ```rust,ignore
/// declare_lint! { pub LINT_1, ... }
/// declare_lint! { pub LINT_2, ... }
/// declare_lint! { pub FORGOTTEN_LINT, ... }
@ -62,12 +62,12 @@ declare_clippy_lint! {
///
/// **Example:**
/// Bad:
/// ```rust
/// ```rust,ignore
/// cx.span_lint(LINT_NAME, "message");
/// ```
///
/// Good:
/// ```rust
/// ```rust,ignore
/// utils::span_lint(cx, LINT_NAME, "message");
/// ```
pub COMPILER_LINT_FUNCTIONS,
@ -85,12 +85,12 @@ declare_clippy_lint! {
///
/// **Example:**
/// Bad:
/// ```rust
/// ```rust,ignore
/// expr.span.ctxt().outer().expn_info()
/// ```
///
/// Good:
/// ```rust
/// ```rust,ignore
/// expr.span.ctxt().outer_expn_info()
/// ```
pub OUTER_EXPN_EXPN_INFO,