@@ -22,7 +22,7 @@ pub(super) struct Context<'cx, 'a> {
22
22
best_case_captures : Vec < Stmt > ,
23
23
// Top-level `let captureN = Capture::new()` statements
24
24
capture_decls : Vec < Capture > ,
25
- cx : & ' cx ExtCtxt < ' a > ,
25
+ cx : & ' cx mut ExtCtxt < ' a > ,
26
26
// Formatting string used for debugging
27
27
fmt_string : String ,
28
28
// If the current expression being visited consumes itself. Used to construct
@@ -41,7 +41,7 @@ pub(super) struct Context<'cx, 'a> {
41
41
}
42
42
43
43
impl < ' cx , ' a > Context < ' cx , ' a > {
44
- pub ( super ) fn new ( cx : & ' cx ExtCtxt < ' a > , span : Span ) -> Self {
44
+ pub ( super ) fn new ( cx : & ' cx mut ExtCtxt < ' a > , span : Span ) -> Self {
45
45
Self {
46
46
best_case_captures : <_ >:: default ( ) ,
47
47
capture_decls : <_ >:: default ( ) ,
@@ -85,8 +85,8 @@ impl<'cx, 'a> Context<'cx, 'a> {
85
85
86
86
let mut assert_then_stmts = ThinVec :: with_capacity ( 2 ) ;
87
87
assert_then_stmts. extend ( best_case_captures) ;
88
- assert_then_stmts. push ( self . cx . stmt_expr ( panic) ) ;
89
- let assert_then = self . cx . block ( span, assert_then_stmts) ;
88
+ assert_then_stmts. push ( cx. stmt_expr ( panic) ) ;
89
+ let assert_then = cx. block ( span, assert_then_stmts) ;
90
90
91
91
let mut stmts = ThinVec :: with_capacity ( 4 ) ;
92
92
stmts. push ( initial_imports) ;
@@ -237,6 +237,9 @@ impl<'cx, 'a> Context<'cx, 'a> {
237
237
self . manage_cond_expr ( prefix) ;
238
238
self . manage_cond_expr ( suffix) ;
239
239
}
240
+ ExprKind :: Matches ( expr, _, _) => {
241
+ self . manage_cond_expr ( expr) ;
242
+ }
240
243
ExprKind :: MethodCall ( call) => {
241
244
for arg in & mut call. args {
242
245
self . manage_cond_expr ( arg) ;
@@ -295,17 +298,17 @@ impl<'cx, 'a> Context<'cx, 'a> {
295
298
| ExprKind :: Continue ( _)
296
299
| ExprKind :: Err
297
300
| ExprKind :: Field ( _, _)
298
- | ExprKind :: FormatArgs ( _)
299
301
| ExprKind :: ForLoop ( _, _, _, _)
302
+ | ExprKind :: FormatArgs ( _)
300
303
| ExprKind :: If ( _, _, _)
301
304
| ExprKind :: IncludedBytes ( ..)
302
305
| ExprKind :: InlineAsm ( _)
303
- | ExprKind :: OffsetOf ( _, _)
304
306
| ExprKind :: Let ( _, _, _)
305
307
| ExprKind :: Lit ( _)
306
308
| ExprKind :: Loop ( _, _, _)
307
309
| ExprKind :: MacCall ( _)
308
310
| ExprKind :: Match ( _, _)
311
+ | ExprKind :: OffsetOf ( _, _)
309
312
| ExprKind :: Path ( _, _)
310
313
| ExprKind :: Ret ( _)
311
314
| ExprKind :: Try ( _)
0 commit comments