parent
18a7dce4da
commit
abfa8a952c
33 changed files with 155 additions and 83 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue