- if let Some(guard) = arm.guard {
- scopes.set_scope(guard, scope);
- compute_expr_scopes(guard, body, scopes, scope);
- }
+ match arm.guard {
+ Some(MatchGuard::If { expr: guard }) => {
+ scopes.set_scope(guard, scope);
+ compute_expr_scopes(guard, body, scopes, scope);
+ }
+ Some(MatchGuard::IfLet { pat, expr: guard }) => {
+ scopes.set_scope(guard, scope);
+ compute_expr_scopes(guard, body, scopes, scope);
+ scope = scopes.new_scope(scope);
+ scopes.add_bindings(body, scope, pat);
+ }
+ _ => {}
+ };