File tree Expand file tree Collapse file tree 4 files changed +16
-14
lines changed Expand file tree Collapse file tree 4 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ declare_lint! {
5757 /// of at end of scope, which is typically incorrect.
5858 ///
5959 /// ### Example
60- /// ```compile_fail
60+ /// ```rust, compile_fail
6161 /// use std::sync::{Arc, Mutex};
6262 /// use std::thread;
6363 /// let data = Arc::new(Mutex::new(0));
Original file line number Diff line number Diff line change @@ -26,19 +26,23 @@ declare_lint! {
2626 ///
2727 /// ### Example
2828 ///
29- /// ```
29+ /// ```rust
30+ /// trait Duh {}
31+ ///
32+ /// impl Duh for i32 {}
33+ ///
3034 /// trait Trait {
31- /// type Assoc: Send ;
35+ /// type Assoc: Duh ;
3236 /// }
3337 ///
3438 /// struct Struct;
3539 ///
36- /// impl Trait for Struct {
37- /// type Assoc = i32 ;
40+ /// impl<F: Duh> Trait for F {
41+ /// type Assoc = F ;
3842 /// }
3943 ///
4044 /// fn test() -> impl Trait<Assoc = impl Sized> {
41- /// Struct
45+ /// 42
4246 /// }
4347 /// ```
4448 ///
Original file line number Diff line number Diff line change @@ -605,7 +605,7 @@ declare_lint! {
605605 ///
606606 /// ### Example
607607 ///
608- /// ```
608+ /// ```rust
609609 /// #[warn(unused_tuple_struct_fields)]
610610 /// struct S(i32, i32, i32);
611611 /// let s = S(1, 2, 3);
@@ -1154,7 +1154,7 @@ declare_lint! {
11541154 ///
11551155 /// ### Example
11561156 ///
1157- /// ```compile_fail
1157+ /// ```rust, compile_fail
11581158 /// #[repr(packed)]
11591159 /// pub struct Foo {
11601160 /// field1: u64,
@@ -2548,7 +2548,7 @@ declare_lint! {
25482548 ///
25492549 /// ### Example
25502550 ///
2551- /// ```compile_fail
2551+ /// ```rust, compile_fail
25522552 /// # #![allow(unused)]
25532553 /// enum E {
25542554 /// A,
@@ -3918,7 +3918,7 @@ declare_lint! {
39183918 ///
39193919 /// ### Example
39203920 ///
3921- /// ```
3921+ /// ```rust
39223922 /// #![allow(test_unstable_lint)]
39233923 /// ```
39243924 ///
Original file line number Diff line number Diff line change @@ -37,10 +37,8 @@ impl Lint {
3737 }
3838
3939 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" ) )
4442 }
4543
4644 /// Checks the doc style of the lint.
You can’t perform that action at this time.
0 commit comments