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]) {
136
136
// Compare against either space or tab, ignoring whether they are
137
137
// mixed or not.
138
138
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
+ )
141
144
}
142
145
} )
143
146
} )
@@ -151,13 +154,13 @@ pub fn unindent_doc_fragments(docs: &mut [DocFragment]) {
151
154
continue ;
152
155
}
153
156
154
- let min_indent = if fragment. kind != DocFragmentKind :: SugaredDoc && min_indent > 0 {
157
+ let indent = if fragment. kind != DocFragmentKind :: SugaredDoc && min_indent > 0 {
155
158
min_indent - add
156
159
} else {
157
160
min_indent
158
161
} ;
159
162
160
- fragment. indent = min_indent ;
163
+ fragment. indent = indent ;
161
164
}
162
165
}
163
166
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