rust/compiler/rustc_codegen_ssa/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
..
back Remove -Z strip. 2023-11-09 11:36:02 +11:00
debuginfo Add hir::GeneratorKind::Gen 2023-10-26 07:10:25 +00:00
mir rename BorrowKind::Shallow to Fake 2023-11-08 22:55:28 +01:00
traits Update doc comment for CodegenBackend::link 2023-11-05 16:29:16 +00:00
assert_module_sources.rs Fix review comments 2023-10-09 18:39:43 +00:00
base.rs Remove cgu_reuse_tracker from Session 2023-10-09 18:39:41 +00:00
codegen_attrs.rs Format all the let chains in compiler 2023-10-13 08:59:36 +00:00
common.rs move ConstValue into mir 2023-09-19 11:11:02 +02:00
errors.rs Remove cgu_reuse_tracker from Session 2023-10-09 18:39:41 +00:00
glue.rs Use size_of_val instead of manual calculation 2023-03-17 19:55:49 -07:00
lib.rs Auto merge of #115964 - bjorn3:cgu_reuse_tracker_global_state, r=cjgillot 2023-10-13 00:09:30 +00:00
meth.rs cg_ssa: remove pointee types and pointercast/bitcast-of-ptr 2023-07-29 13:18:20 -04:00
mono_item.rs inline format!() args up to and including rustc_codegen_llvm 2023-07-30 14:22:50 +02:00
target_features.rs warn when using an unstable feature with -Ctarget-feature 2023-11-06 09:44:00 +01:00