We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6d6be5f commit bf21a81Copy full SHA for bf21a81
compiler/rustc_typeck/src/check/generator_interior/drop_ranges/record_consumed_borrow.rs
@@ -211,8 +211,10 @@ impl<'tcx> expr_use_visitor::Delegate<'tcx> for ExprUseDelegate<'tcx> {
211
"fake_read place_with_id={place_with_id:?}; cause={cause:?}; diag_expr_id={diag_expr_id:?}"
212
);
213
214
- // fake reads happen in places like the scrutinee of a match expression, so we can treat
215
- // these as a borrow.
+ // fake reads happen in places like the scrutinee of a match expression.
+ // 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).
218
self.borrow_place(place_with_id);
219
}
220
0 commit comments