Skip to content

Commit bf21a81

Browse files
authored
Update compiler/rustc_typeck/src/check/generator_interior/drop_ranges/record_consumed_borrow.rs
1 parent 6d6be5f commit bf21a81

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

compiler/rustc_typeck/src/check/generator_interior/drop_ranges/record_consumed_borrow.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,10 @@ impl<'tcx> expr_use_visitor::Delegate<'tcx> for ExprUseDelegate<'tcx> {
211211
"fake_read place_with_id={place_with_id:?}; cause={cause:?}; diag_expr_id={diag_expr_id:?}"
212212
);
213213

214-
// fake reads happen in places like the scrutinee of a match expression, so we can treat
215-
// these as a borrow.
214+
// fake reads happen in places like the scrutinee of a match expression.
215+
// we treat those as a borrow, much like a copy: the idea is that we are
216+
// transiently creating a `&T` ref that we can read from to observe the current
217+
// value (this `&T` is immediately dropped afterwards).
216218
self.borrow_place(place_with_id);
217219
}
218220
}

0 commit comments

Comments
 (0)