File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,9 @@ pub fn rewrite_chain(expr: &ast::Expr,
179
179
format ! ( "\n {}" , indent. to_string( context. config) )
180
180
} ;
181
181
182
- let first_connector = if extend {
182
+ let first_connector = if extend || subexpr_list. len ( ) == 0 {
183
+ ""
184
+ } else if let ast:: ExprKind :: Try ( _) = subexpr_list[ 0 ] . node {
183
185
""
184
186
} else {
185
187
& * connector
Original file line number Diff line number Diff line change @@ -124,4 +124,12 @@ fn try_shorthand() {
124
124
let y = a. very . loooooooooooooooooooooooooooooooooooooong ( ) . chain ( )
125
125
. inside ( ) . weeeeeeeeeeeeeee ( ) ? . test ( ) . 0
126
126
. x ;
127
+
128
+ parameterized ( f,
129
+ substs,
130
+ def_id,
131
+ Ns :: Value ,
132
+ & [ ] ,
133
+ |tcx| tcx. lookup_item_type ( def_id) . generics ) ?;
134
+ fooooooooooooooooooooooooooo ( ) ?. bar ( ) ?. baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz ( ) ?;
127
135
}
Original file line number Diff line number Diff line change @@ -151,4 +151,14 @@ fn try_shorthand() {
151
151
. test ( )
152
152
. 0
153
153
. x ;
154
+
155
+ parameterized ( f,
156
+ substs,
157
+ def_id,
158
+ Ns :: Value ,
159
+ & [ ] ,
160
+ |tcx| tcx. lookup_item_type ( def_id) . generics ) ?;
161
+ fooooooooooooooooooooooooooo ( ) ?
162
+ . bar ( ) ?
163
+ . baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz ( ) ?;
154
164
}
You can’t perform that action at this time.
0 commit comments