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

This commit is contained in:
Niko Matsakis 2022-05-20 15:54:22 -04:00 committed by GitHub
parent 6d6be5fd8b
commit bf21a81b15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -211,8 +211,10 @@ fn fake_read(
"fake_read place_with_id={place_with_id:?}; cause={cause:?}; diag_expr_id={diag_expr_id:?}"
);
// fake reads happen in places like the scrutinee of a match expression, so we can treat
// 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
// transiently creating a `&T` ref that we can read from to observe the current
// value (this `&T` is immediately dropped afterwards).
self.borrow_place(place_with_id);
}
}