File tree 4 files changed +16
-14
lines changed
4 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ declare_lint! {
57
57
/// of at end of scope, which is typically incorrect.
58
58
///
59
59
/// ### Example
60
- /// ```compile_fail
60
+ /// ```rust, compile_fail
61
61
/// use std::sync::{Arc, Mutex};
62
62
/// use std::thread;
63
63
/// let data = Arc::new(Mutex::new(0));
Original file line number Diff line number Diff line change @@ -26,19 +26,23 @@ declare_lint! {
26
26
///
27
27
/// ### Example
28
28
///
29
- /// ```
29
+ /// ```rust
30
+ /// trait Duh {}
31
+ ///
32
+ /// impl Duh for i32 {}
33
+ ///
30
34
/// trait Trait {
31
- /// type Assoc: Send ;
35
+ /// type Assoc: Duh ;
32
36
/// }
33
37
///
34
38
/// struct Struct;
35
39
///
36
- /// impl Trait for Struct {
37
- /// type Assoc = i32 ;
40
+ /// impl<F: Duh> Trait for F {
41
+ /// type Assoc = F ;
38
42
/// }
39
43
///
40
44
/// fn test() -> impl Trait<Assoc = impl Sized> {
41
- /// Struct
45
+ /// 42
42
46
/// }
43
47
/// ```
44
48
///
Original file line number Diff line number Diff line change @@ -605,7 +605,7 @@ declare_lint! {
605
605
///
606
606
/// ### Example
607
607
///
608
- /// ```
608
+ /// ```rust
609
609
/// #[warn(unused_tuple_struct_fields)]
610
610
/// struct S(i32, i32, i32);
611
611
/// let s = S(1, 2, 3);
@@ -1154,7 +1154,7 @@ declare_lint! {
1154
1154
///
1155
1155
/// ### Example
1156
1156
///
1157
- /// ```compile_fail
1157
+ /// ```rust, compile_fail
1158
1158
/// #[repr(packed)]
1159
1159
/// pub struct Foo {
1160
1160
/// field1: u64,
@@ -2548,7 +2548,7 @@ declare_lint! {
2548
2548
///
2549
2549
/// ### Example
2550
2550
///
2551
- /// ```compile_fail
2551
+ /// ```rust, compile_fail
2552
2552
/// # #![allow(unused)]
2553
2553
/// enum E {
2554
2554
/// A,
@@ -3918,7 +3918,7 @@ declare_lint! {
3918
3918
///
3919
3919
/// ### Example
3920
3920
///
3921
- /// ```
3921
+ /// ```rust
3922
3922
/// #![allow(test_unstable_lint)]
3923
3923
/// ```
3924
3924
///
Original file line number Diff line number Diff line change @@ -37,10 +37,8 @@ impl Lint {
37
37
}
38
38
39
39
fn is_ignored ( & self ) -> bool {
40
- self . doc
41
- . iter ( )
42
- . filter ( |line| line. starts_with ( "```rust" ) )
43
- . all ( |line| line. contains ( ",ignore" ) )
40
+ let blocks: Vec < _ > = self . doc . iter ( ) . filter ( |line| line. starts_with ( "```rust" ) ) . collect ( ) ;
41
+ !blocks. is_empty ( ) && blocks. iter ( ) . all ( |line| line. contains ( ",ignore" ) )
44
42
}
45
43
46
44
/// Checks the doc style of the lint.
You can’t perform that action at this time.
0 commit comments