@@ -141,27 +141,27 @@ pub const PASSES: &'static [Pass] = &[
141141] ;
142142
143143/// The list of passes run by default.
144- pub const DEFAULT_PASSES : & ' static [ & ' static str ] = & [
144+ pub const DEFAULT_PASSES : & [ & str ] = & [
145145 "collect-trait-impls" ,
146+ "collapse-docs" ,
147+ "unindent-comments" ,
146148 "check-private-items-doc-tests" ,
147149 "strip-hidden" ,
148150 "strip-private" ,
149151 "collect-intra-doc-links" ,
150152 "check-code-block-syntax" ,
151- "collapse-docs" ,
152- "unindent-comments" ,
153153 "propagate-doc-cfg" ,
154154] ;
155155
156156/// The list of default passes run with `--document-private-items` is passed to rustdoc.
157- pub const DEFAULT_PRIVATE_PASSES : & ' static [ & ' static str ] = & [
157+ pub const DEFAULT_PRIVATE_PASSES : & [ & str ] = & [
158158 "collect-trait-impls" ,
159+ "collapse-docs" ,
160+ "unindent-comments" ,
159161 "check-private-items-doc-tests" ,
160162 "strip-priv-imports" ,
161163 "collect-intra-doc-links" ,
162164 "check-code-block-syntax" ,
163- "collapse-docs" ,
164- "unindent-comments" ,
165165 "propagate-doc-cfg" ,
166166] ;
167167
@@ -438,11 +438,11 @@ crate fn source_span_for_markdown_range(
438438 . span_to_snippet ( span_of_attrs ( attrs) )
439439 . ok ( ) ?;
440440
441- let starting_line = markdown[ ..md_range. start ] . lines ( ) . count ( ) - 1 ;
442- let ending_line = markdown[ .. md_range. end ] . lines ( ) . count ( ) - 1 ;
441+ let starting_line = markdown[ ..md_range. start ] . matches ( '\n' ) . count ( ) ;
442+ let ending_line = starting_line + markdown[ md_range . start .. md_range. end ] . matches ( '\n' ) . count ( ) ;
443443
444- // We use `split_terminator('\n')` instead of `lines()` when counting bytes so that we only
445- // we can treat CRLF and LF line endings the same way.
444+ // We use `split_terminator('\n')` instead of `lines()` when counting bytes so that we treat
445+ // CRLF and LF line endings the same way.
446446 let mut src_lines = snippet. split_terminator ( '\n' ) ;
447447 let md_lines = markdown. split_terminator ( '\n' ) ;
448448
0 commit comments