diff options
| author | Folkert de Vries <folkert@folkertdev.nl> | 2025-07-01 15:29:09 +0200 |
|---|---|---|
| committer | Folkert de Vries <folkert@folkertdev.nl> | 2025-07-01 15:53:50 +0200 |
| commit | aa7cc5d2f453853a4025cf029f3e42625c7e1e18 (patch) | |
| tree | a830f16c26270c0006260800d4170fe5ebe829c2 /compiler/rustc_middle/src/thir | |
| parent | f46ce66fcc3d6058f90ac5bf0930f940f1e7b0ca (diff) | |
| download | rust-aa7cc5d2f453853a4025cf029f3e42625c7e1e18.tar.gz rust-aa7cc5d2f453853a4025cf029f3e42625c7e1e18.zip | |
loop match: run exhaustiveness check
Diffstat (limited to 'compiler/rustc_middle/src/thir')
| -rw-r--r-- | compiler/rustc_middle/src/thir/visit.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/thir/visit.rs b/compiler/rustc_middle/src/thir/visit.rs index c9ef723aea4..dcfa6c4db32 100644 --- a/compiler/rustc_middle/src/thir/visit.rs +++ b/compiler/rustc_middle/src/thir/visit.rs @@ -2,6 +2,7 @@ use super::{ AdtExpr, AdtExprBase, Arm, Block, ClosureExpr, Expr, ExprKind, InlineAsmExpr, InlineAsmOperand, Pat, PatKind, Stmt, StmtKind, Thir, }; +use crate::thir::LoopMatchMatchData; /// Every `walk_*` method uses deconstruction to access fields of structs and /// enums. This will result in a compile error if a field is added, which makes @@ -83,7 +84,8 @@ pub fn walk_expr<'thir, 'tcx: 'thir, V: Visitor<'thir, 'tcx>>( visitor.visit_pat(pat); } Loop { body } => visitor.visit_expr(&visitor.thir()[body]), - LoopMatch { state: scrutinee, ref arms, .. } | Match { scrutinee, ref arms, .. } => { + LoopMatch { match_data: box LoopMatchMatchData { scrutinee, ref arms, .. }, .. } + | Match { scrutinee, ref arms, .. } => { visitor.visit_expr(&visitor.thir()[scrutinee]); for &arm in &**arms { visitor.visit_arm(&visitor.thir()[arm]); |
