File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -309,7 +309,7 @@ declare_clippy_lint! {
309
309
/// ### Known problems
310
310
/// Inner doc comments can only appear before items, so there are certain cases where the suggestion
311
311
/// made by this lint is not valid code. For example:
312
- /// ```rs
312
+ /// ```rust
313
313
/// fn foo() {}
314
314
/// ///!
315
315
/// fn bar() {}
Original file line number Diff line number Diff line change @@ -2702,10 +2702,10 @@ declare_clippy_lint! {
2702
2702
/// }
2703
2703
/// })
2704
2704
/// }
2705
- /// ```
2705
+ /// ```
2706
2706
///
2707
- /// After:
2708
- /// ```rust
2707
+ /// After:
2708
+ /// ```rust
2709
2709
/// use std::{fmt, num::ParseIntError};
2710
2710
///
2711
2711
/// #[derive(Debug)]
Original file line number Diff line number Diff line change @@ -687,10 +687,12 @@ fn cleanup_docs(docs_collection: &Vec<String>) -> String {
687
687
. trim ( )
688
688
. split ( ',' )
689
689
// remove rustdoc directives
690
- . find ( |& s| !matches ! ( s, "" | "ignore" | "no_run" | "should_panic" ) )
690
+ . find ( |& s| !matches ! ( s, "" | "ignore" | "no_run" | "should_panic" | "compile_fail" ) )
691
691
// if no language is present, fill in "rust"
692
692
. unwrap_or ( "rust" ) ;
693
- let len_diff = line. len ( ) - line. trim_start ( ) . len ( ) ;
693
+ let len_diff = line
694
+ . strip_prefix ( ' ' )
695
+ . map_or ( 0 , |line| line. len ( ) - line. trim_start ( ) . len ( ) ) ;
694
696
if len_diff != 0 {
695
697
// We put back the indentation.
696
698
docs. push_str ( & line[ ..len_diff] ) ;
You can’t perform that action at this time.
0 commit comments