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! {
309309 /// ### Known problems
310310 /// Inner doc comments can only appear before items, so there are certain cases where the suggestion
311311 /// made by this lint is not valid code. For example:
312- /// ```rs
312+ /// ```rust
313313 /// fn foo() {}
314314 /// ///!
315315 /// fn bar() {}
Original file line number Diff line number Diff line change @@ -2702,10 +2702,10 @@ declare_clippy_lint! {
27022702 /// }
27032703 /// })
27042704 /// }
2705- /// ```
2705+ /// ```
27062706 ///
2707- /// After:
2708- /// ```rust
2707+ /// After:
2708+ /// ```rust
27092709 /// use std::{fmt, num::ParseIntError};
27102710 ///
27112711 /// #[derive(Debug)]
Original file line number Diff line number Diff line change @@ -687,10 +687,12 @@ fn cleanup_docs(docs_collection: &Vec<String>) -> String {
687687 . trim ( )
688688 . split ( ',' )
689689 // 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" ) )
691691 // if no language is present, fill in "rust"
692692 . 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 ( ) ) ;
694696 if len_diff != 0 {
695697 // We put back the indentation.
696698 docs. push_str ( & line[ ..len_diff] ) ;
You can’t perform that action at this time.
0 commit comments