Skip to content

Commit 2a21c0f

Browse files
committed
Update bind_and_guard_matched_candidate docs.
1 parent 961a4da commit 2a21c0f

File tree

1 file changed

+3
-7
lines changed
  • src/librustc_mir/build/matches

1 file changed

+3
-7
lines changed

src/librustc_mir/build/matches/mod.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,13 +1345,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
13451345
/// any, and then branches to the arm. Returns the block for the case where
13461346
/// the guard fails.
13471347
///
1348-
/// Note: we check earlier that if there is a guard, there cannot be move
1349-
/// bindings (unless feature(bind_by_move_pattern_guards) is used). This
1350-
/// isn't really important for the self-consistency of this fn, but the
1351-
/// reason for it should be clear: after we've done the assignments, if
1352-
/// there were move bindings, further tests would be a use-after-move.
1353-
/// bind_by_move_pattern_guards avoids this by only moving the binding once
1354-
/// the guard has evaluated to true (see below).
1348+
/// Note: we do not check earlier that if there is a guard,
1349+
/// there cannot be move bindings. We avoid a use-after-move by only
1350+
/// moving the binding once the guard has evaluated to true (see below).
13551351
fn bind_and_guard_matched_candidate<'pat>(
13561352
&mut self,
13571353
candidate: Candidate<'pat, 'tcx>,

0 commit comments

Comments
 (0)