diff options
| author | Ding Xiang Fei <dingxiangfei2009@protonmail.ch> | 2022-07-12 13:24:08 +0200 |
|---|---|---|
| committer | Ding Xiang Fei <dingxiangfei2009@protonmail.ch> | 2022-07-12 13:24:08 +0200 |
| commit | 947cbda5eb557ee3015b2310adfc80a393e42051 (patch) | |
| tree | 5455283a4e6bf1151008c1b65033beca21d3b1d7 | |
| parent | 5374688e1d8cbcff7d1d14bb34e38fe6fe7c233e (diff) | |
| download | rust-947cbda5eb557ee3015b2310adfc80a393e42051.tar.gz rust-947cbda5eb557ee3015b2310adfc80a393e42051.zip | |
fix the typo
| -rw-r--r-- | compiler/rustc_typeck/src/expr_use_visitor.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_typeck/src/expr_use_visitor.rs b/compiler/rustc_typeck/src/expr_use_visitor.rs index 53a456cf946..9d7420acd26 100644 --- a/compiler/rustc_typeck/src/expr_use_visitor.rs +++ b/compiler/rustc_typeck/src/expr_use_visitor.rs @@ -498,12 +498,10 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> { f(self); if let Some(els) = els { // borrowing because we need to test the descriminant - // self.borrow_expr(expr, ImmBorrow); - self.maybe_read_scrutinee(expr, expr_place, from_ref(pat).iter()); + self.maybe_read_scrutinee(expr, expr_place.clone(), from_ref(pat).iter()); self.walk_block(els) - } else { - self.walk_irrefutable_pat(&expr_place, &pat); } + self.walk_irrefutable_pat(&expr_place, &pat); } /// Indicates that the value of `blk` will be consumed, meaning either copied or moved |
