File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
compiler/rustc_resolve/src Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -136,8 +136,11 @@ pub fn unindent_doc_fragments(docs: &mut [DocFragment]) {
136136 // Compare against either space or tab, ignoring whether they are
137137 // mixed or not.
138138 let whitespace = line. chars ( ) . take_while ( |c| * c == ' ' || * c == '\t' ) . count ( ) ;
139- cmp:: min ( min_indent, whitespace)
140- + if fragment. kind == DocFragmentKind :: SugaredDoc { 0 } else { add }
139+ cmp:: min (
140+ min_indent,
141+ whitespace
142+ + ( if fragment. kind == DocFragmentKind :: SugaredDoc { 0 } else { add } ) ,
143+ )
141144 }
142145 } )
143146 } )
@@ -151,13 +154,13 @@ pub fn unindent_doc_fragments(docs: &mut [DocFragment]) {
151154 continue ;
152155 }
153156
154- let min_indent = if fragment. kind != DocFragmentKind :: SugaredDoc && min_indent > 0 {
157+ let indent = if fragment. kind != DocFragmentKind :: SugaredDoc && min_indent > 0 {
155158 min_indent - add
156159 } else {
157160 min_indent
158161 } ;
159162
160- fragment. indent = min_indent ;
163+ fragment. indent = indent ;
161164 }
162165}
163166
Original file line number Diff line number Diff line change 1+ /**
2+ */
3+ pub mod A {
4+ #![ doc = "{
5+ Foo { },
6+ }" ]
7+ }
You can’t perform that action at this time.
0 commit comments