rust/compiler
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
..
rustc
rustc_abi
rustc_arena
rustc_ast
rustc_ast_lowering
rustc_ast_passes
rustc_ast_pretty
rustc_attr
rustc_baked_icu_data
rustc_borrowck Auto merge of #117712 - lcnr:expand-coroutine, r=jackh726 2023-11-09 14:23:45 +00:00
rustc_builtin_macros
rustc_codegen_cranelift
rustc_codegen_gcc
rustc_codegen_llvm
rustc_codegen_ssa Auto merge of #117712 - lcnr:expand-coroutine, r=jackh726 2023-11-09 14:23:45 +00:00
rustc_const_eval Auto merge of #117712 - lcnr:expand-coroutine, r=jackh726 2023-11-09 14:23:45 +00:00
rustc_data_structures
rustc_driver
rustc_driver_impl
rustc_error_codes
rustc_error_messages
rustc_errors
rustc_expand
rustc_feature
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir
rustc_hir_analysis
rustc_hir_pretty
rustc_hir_typeck
rustc_incremental
rustc_index
rustc_infer
rustc_interface
rustc_lexer
rustc_lint
rustc_lint_defs
rustc_llvm
rustc_log
rustc_macros
rustc_metadata
rustc_middle
rustc_mir_build Auto merge of #117712 - lcnr:expand-coroutine, r=jackh726 2023-11-09 14:23:45 +00:00
rustc_mir_dataflow
rustc_mir_transform Auto merge of #117712 - lcnr:expand-coroutine, r=jackh726 2023-11-09 14:23:45 +00:00
rustc_monomorphize
rustc_parse
rustc_parse_format
rustc_passes
rustc_privacy
rustc_query_impl
rustc_query_system
rustc_resolve
rustc_serialize
rustc_session
rustc_smir
rustc_span
rustc_symbol_mangling
rustc_target
rustc_trait_selection Auto merge of #117712 - lcnr:expand-coroutine, r=jackh726 2023-11-09 14:23:45 +00:00
rustc_traits
rustc_transmute
rustc_ty_utils
rustc_type_ir
stable_mir