@@ -7,7 +7,7 @@ use clippy_config::Conf;
77use clippy_utils:: attrs:: is_doc_hidden;
88use clippy_utils:: diagnostics:: { span_lint, span_lint_and_help, span_lint_and_then} ;
99use clippy_utils:: macros:: { is_panic, root_macro_call_first_node} ;
10- use clippy_utils:: source:: snippet ;
10+ use clippy_utils:: source:: snippet_opt ;
1111use clippy_utils:: ty:: is_type_diagnostic_item;
1212use clippy_utils:: visitors:: Visitable ;
1313use clippy_utils:: { is_entrypoint_fn, is_trait_impl_item, method_chain_args} ;
@@ -626,11 +626,11 @@ declare_clippy_lint! {
626626}
627627
628628declare_clippy_lint ! {
629- /// Detects doc comment linebreaks that use double spaces to separate lines, instead of back-slash (\ ).
629+ /// Detects doc comment linebreaks that use double spaces to separate lines, instead of back-slash (`\` ).
630630 ///
631631 /// ### Why is this bad?
632632 /// Double spaces, when used as doc comment linebreaks, can be difficult to see, and may
633- /// accidentally be removed during automatic formatting or manual refactoring. The use of a back-slash (\ )
633+ /// accidentally be removed during automatic formatting or manual refactoring. The use of a back-slash (`\` )
634634 /// is clearer in this regard.
635635 ///
636636 /// ### Example
@@ -909,6 +909,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
909909 let mut code_level = 0 ;
910910 let mut blockquote_level = 0 ;
911911 let mut collected_breaks: Vec < Span > = Vec :: new ( ) ;
912+ let mut is_first_paragraph = true ;
912913
913914 let mut containers = Vec :: new ( ) ;
914915
@@ -1085,7 +1086,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
10851086
10861087 if let Some ( span) = fragments. span ( cx, range. clone ( ) )
10871088 && !span. from_expansion ( )
1088- && let snippet = snippet ( cx, span, ".." )
1089+ && let Some ( snippet) = snippet_opt ( cx, span)
10891090 && !snippet. trim ( ) . starts_with ( '\\' )
10901091 && event == HardBreak {
10911092 collected_breaks. push ( span) ;
0 commit comments