Skip to content

Commit dd522e6

Browse files
committed
fix or ignore failing doc tests
1 parent d854e03 commit dd522e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+137
-127
lines changed

clippy_lints/src/assertions_on_constants.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ declare_clippy_lint! {
1515
/// **Known problems:** None
1616
///
1717
/// **Example:**
18-
/// ```rust
19-
/// assert!(false)
18+
/// ```no_run
19+
/// assert!(false);
2020
/// // or
21-
/// assert!(true)
21+
/// assert!(true);
2222
/// // or
2323
/// const B: bool = false;
24-
/// assert!(B)
24+
/// assert!(B);
2525
/// ```
2626
pub ASSERTIONS_ON_CONSTANTS,
2727
style,

clippy_lints/src/assign_ops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ declare_clippy_lint! {
1717
/// implementations that differ from the regular `Op` impl.
1818
///
1919
/// **Example:**
20-
/// ```rust
20+
/// ```ignore
2121
/// let mut a = 5;
2222
/// ...
2323
/// a = a + b;
@@ -39,7 +39,7 @@ declare_clippy_lint! {
3939
/// written as `a = a op a op b` as it's less confusing.
4040
///
4141
/// **Example:**
42-
/// ```rust
42+
/// ```ignore
4343
/// let mut a = 5;
4444
/// ...
4545
/// a += a + b;

clippy_lints/src/attrs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ declare_clippy_lint! {
3434
/// done the measurement.
3535
///
3636
/// **Example:**
37-
/// ```rust
37+
/// ```ignore
3838
/// #[inline(always)]
3939
/// fn not_quite_hot_code(..) { ... }
4040
/// ```
@@ -57,7 +57,7 @@ declare_clippy_lint! {
5757
/// **Known problems:** None.
5858
///
5959
/// **Example:**
60-
/// ```rust
60+
/// ```ignore
6161
/// // Bad
6262
/// #[deny(dead_code)]
6363
/// extern crate foo;
@@ -88,7 +88,7 @@ declare_clippy_lint! {
8888
/// **Example:**
8989
/// ```rust
9090
/// #[deprecated(since = "forever")]
91-
/// fn something_else(..) { ... }
91+
/// fn something_else() { /* ... */ }
9292
/// ```
9393
pub DEPRECATED_SEMVER,
9494
correctness,

clippy_lints/src/bit_mask.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ declare_clippy_lint! {
3737
/// **Known problems:** None.
3838
///
3939
/// **Example:**
40-
/// ```rust
40+
/// ```ignore
4141
/// if (x & 1 == 2) { … }
4242
/// ```
4343
pub BAD_BIT_MASK,
@@ -65,7 +65,7 @@ declare_clippy_lint! {
6565
/// uncommon).
6666
///
6767
/// **Example:**
68-
/// ```rust
68+
/// ```ignore
6969
/// if (x | 1 > 3) { … }
7070
/// ```
7171
pub INEFFECTIVE_BIT_MASK,
@@ -83,7 +83,7 @@ declare_clippy_lint! {
8383
/// **Known problems:** llvm generates better code for `x & 15 == 0` on x86
8484
///
8585
/// **Example:**
86-
/// ```rust
86+
/// ```ignore
8787
/// x & 0x1111 == 0
8888
/// ```
8989
pub VERBOSE_BIT_MASK,

clippy_lints/src/block_in_if_condition.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ declare_clippy_lint! {
1616
///
1717
/// **Example:**
1818
/// ```rust
19-
/// if { true } ..
19+
/// if { true } { /* ... */ }
2020
/// ```
2121
pub BLOCK_IN_IF_CONDITION_EXPR,
2222
style,
@@ -32,10 +32,10 @@ declare_clippy_lint! {
3232
/// **Known problems:** None.
3333
///
3434
/// **Example:**
35-
/// ```rust
36-
/// if { let x = somefunc(); x } ..
35+
/// ```ignore
36+
/// if { let x = somefunc(); x } {}
3737
/// // or
38-
/// if somefunc(|x| { x == 47 }) ..
38+
/// if somefunc(|x| { x == 47 }) {}
3939
/// ```
4040
pub BLOCK_IN_IF_CONDITION_STMT,
4141
style,

clippy_lints/src/booleans.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ declare_clippy_lint! {
2121
/// `&&`. Ignores `|`, `&` and `^`.
2222
///
2323
/// **Example:**
24-
/// ```rust
24+
/// ```ignore
2525
/// if a && true // should be: if a
2626
/// if !(a == b) // should be: if a != b
2727
/// ```
@@ -39,7 +39,7 @@ declare_clippy_lint! {
3939
/// **Known problems:** Ignores short circuiting behavior.
4040
///
4141
/// **Example:**
42-
/// ```rust
42+
/// ```ignore
4343
/// if a && b || a { ... }
4444
/// ```
4545
/// The `b` is unnecessary, the expression is equivalent to `if a`.

clippy_lints/src/const_static_lifetime.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ declare_clippy_lint! {
1313
/// **Known problems:** None.
1414
///
1515
/// **Example:**
16-
/// ```rust
16+
/// ```ignore
1717
/// const FOO: &'static [(&'static str, &'static str, fn(&Bar) -> bool)] =
1818
/// &[...]
1919
/// ```
2020
/// This code can be rewritten as
21-
/// ```rust
21+
/// ```ignore
2222
/// const FOO: &[(&str, &str, fn(&Bar) -> bool)] = &[...]
2323
/// ```
2424
pub CONST_STATIC_LIFETIME,

clippy_lints/src/copies.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ declare_clippy_lint! {
1818
/// **Known problems:** Hopefully none.
1919
///
2020
/// **Example:**
21-
/// ```rust
21+
/// ```ignore
2222
/// if a == b {
2323
/// …
2424
/// } else if a == b {
@@ -29,7 +29,7 @@ declare_clippy_lint! {
2929
/// Note that this lint ignores all conditions with a function call as it could
3030
/// have side effects:
3131
///
32-
/// ```rust
32+
/// ```ignore
3333
/// if foo() {
3434
/// …
3535
/// } else if foo() { // not linted
@@ -50,7 +50,7 @@ declare_clippy_lint! {
5050
/// **Known problems:** Hopefully none.
5151
///
5252
/// **Example:**
53-
/// ```rust
53+
/// ```ignore
5454
/// let foo = if … {
5555
/// 42
5656
/// } else {

clippy_lints/src/derive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ declare_clippy_lint! {
1616
/// default-generated `Hash` implementation with an explicitly defined
1717
/// `PartialEq`. In particular, the following must hold for any type:
1818
///
19-
/// ```rust
19+
/// ```text
2020
/// k1 == k2 ⇒ hash(k1) == hash(k2)
2121
/// ```
2222
///
2323
/// **Known problems:** None.
2424
///
2525
/// **Example:**
26-
/// ```rust
26+
/// ```ignore
2727
/// #[derive(Hash)]
2828
/// struct Foo;
2929
///

clippy_lints/src/drop_forget_ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ declare_clippy_lint! {
1717
/// **Known problems:** None.
1818
///
1919
/// **Example:**
20-
/// ```rust
20+
/// ```ignore
2121
/// let mut lock_guard = mutex.lock();
2222
/// std::mem::drop(&lock_guard) // Should have been drop(lock_guard), mutex
2323
/// // still locked

0 commit comments

Comments
 (0)