rust/compiler/rustc_mir_build/src
bors b7583d38b7 Auto merge of #117712 - lcnr:expand-coroutine, r=jackh726
generator layout: ignore fake borrows

fixes #117059

We emit fake shallow borrows in case the scrutinee place uses a `Deref` and there is a match guard. This is necessary to prevent the match guard from mutating the scrutinee: fab1054e17/compiler/rustc_mir_build/src/build/matches/mod.rs (L1250-L1265)

These fake borrows end up impacting the generator witness computation in `mir_generator_witnesses`, which causes the issue in #117059. This PR now completely ignores fake borrows during this computation. This is sound as thse are always removed after analysis and the actual computation of the generator layout happens afterwards.

Only the second commit impacts behavior, and could be backported by itself.

r? types
2023-11-09 14:23:45 +00:00
..
build rename BorrowKind::Shallow to Fake 2023-11-08 22:55:28 +01:00
thir Auto merge of #116930 - RalfJung:raw-ptr-match, r=davidtwco 2023-11-08 20:42:32 +00:00
check_unsafety.rs rename BorrowKind::Shallow to Fake 2023-11-08 22:55:28 +01:00
errors.rs Add suggestion to THIR unsafe_op_in_unsafe_fn lint 2023-11-06 16:23:09 +00:00
lib.rs Make THIR unused_unsafe lint consistent with MIR 2023-10-25 10:10:13 +00:00
lints.rs s/Generator/Coroutine/ 2023-10-20 21:10:38 +00:00