@@ -22,7 +22,7 @@ pub(super) struct Context<'cx, 'a> {
2222 best_case_captures : Vec < Stmt > ,
2323 // Top-level `let captureN = Capture::new()` statements
2424 capture_decls : Vec < Capture > ,
25- cx : & ' cx ExtCtxt < ' a > ,
25+ cx : & ' cx mut ExtCtxt < ' a > ,
2626 // Formatting string used for debugging
2727 fmt_string : String ,
2828 // If the current expression being visited consumes itself. Used to construct
@@ -41,7 +41,7 @@ pub(super) struct Context<'cx, 'a> {
4141}
4242
4343impl < ' 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 {
4545 Self {
4646 best_case_captures : <_ >:: default ( ) ,
4747 capture_decls : <_ >:: default ( ) ,
@@ -85,8 +85,8 @@ impl<'cx, 'a> Context<'cx, 'a> {
8585
8686 let mut assert_then_stmts = ThinVec :: with_capacity ( 2 ) ;
8787 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) ;
9090
9191 let mut stmts = ThinVec :: with_capacity ( 4 ) ;
9292 stmts. push ( initial_imports) ;
@@ -237,6 +237,9 @@ impl<'cx, 'a> Context<'cx, 'a> {
237237 self . manage_cond_expr ( prefix) ;
238238 self . manage_cond_expr ( suffix) ;
239239 }
240+ ExprKind :: Matches ( expr, _, _) => {
241+ self . manage_cond_expr ( expr) ;
242+ }
240243 ExprKind :: MethodCall ( call) => {
241244 for arg in & mut call. args {
242245 self . manage_cond_expr ( arg) ;
@@ -295,17 +298,17 @@ impl<'cx, 'a> Context<'cx, 'a> {
295298 | ExprKind :: Continue ( _)
296299 | ExprKind :: Err
297300 | ExprKind :: Field ( _, _)
298- | ExprKind :: FormatArgs ( _)
299301 | ExprKind :: ForLoop ( _, _, _, _)
302+ | ExprKind :: FormatArgs ( _)
300303 | ExprKind :: If ( _, _, _)
301304 | ExprKind :: IncludedBytes ( ..)
302305 | ExprKind :: InlineAsm ( _)
303- | ExprKind :: OffsetOf ( _, _)
304306 | ExprKind :: Let ( _, _, _)
305307 | ExprKind :: Lit ( _)
306308 | ExprKind :: Loop ( _, _, _)
307309 | ExprKind :: MacCall ( _)
308310 | ExprKind :: Match ( _, _)
311+ | ExprKind :: OffsetOf ( _, _)
309312 | ExprKind :: Path ( _, _)
310313 | ExprKind :: Ret ( _)
311314 | ExprKind :: Try ( _)
0 commit comments