rust/compiler
Matthias Krüger fa62fbe4b8
Rollup merge of #137257 - compiler-errors:fake-borrow-of-packed-field, r=oli-obk
Ignore fake borrows for packed field check

We should not emit unaligned packed field reference errors for the fake borrows that we generate during match lowering.

These fake borrows are there to ensure in *borrow-checking* that we don't modify the value being matched (which is why this only occurs when there's a match guard, in this case `if true`), but they are removed after the MIR is processed by `CleanupPostBorrowck`, since they're really just there to cause borrowck errors if necessary.

I modified `PlaceContext::is_borrow` since that's used by the packed field check:
17c1c329a5/compiler/rustc_mir_transform/src/check_packed_ref.rs (L40)

It's only used in one other place, in the SROA optimization (by which fake borrows are removed, so it doesn't matter):
17c1c329a5/compiler/rustc_mir_dataflow/src/value_analysis.rs (L922)

Fixes https://github.com/rust-lang/rust/issues/137250
2025-02-22 01:01:41 +01:00
..
rustc
rustc_abi Adjust LayoutData::uninhabited doc comment. 2025-02-20 13:41:24 -06:00
rustc_arena Add inherent versions of MaybeUninit methods for slices 2025-01-11 23:57:00 -05:00
rustc_ast Add a TyPat in the AST to reuse the generic arg lowering logic 2025-02-11 08:51:05 +00:00
rustc_ast_ir Make fewer crates depend on rustc_ast_ir 2025-02-19 07:06:54 +00:00
rustc_ast_lowering Move some Map methods onto TyCtxt. 2025-02-17 13:21:02 +11:00
rustc_ast_passes compiler: remove rustc_target reexport of rustc_abi::HashStableContext 2025-02-11 18:55:48 -08:00
rustc_ast_pretty Add a TyPat in the AST to reuse the generic arg lowering logic 2025-02-11 08:51:05 +00:00
rustc_attr_data_structures rustc_allowed_through_unstable_modules: require deprecation message 2025-02-02 12:36:12 +01:00
rustc_attr_parsing Rustfmt 2025-02-08 22:12:13 +00:00
rustc_baked_icu_data
rustc_borrowck Auto merge of #137397 - matthiaskrgr:rollup-ls2pilo, r=matthiaskrgr 2025-02-21 19:57:50 +00:00
rustc_builtin_macros Rollup merge of #136646 - oli-obk:pattern-types-ast, r=BoxyUwU 2025-02-12 06:07:37 +01:00
rustc_codegen_cranelift Remove BackendRepr::Uninhabited, replaced with an uninhabited: bool field in LayoutData. 2025-02-20 13:27:32 -06:00
rustc_codegen_gcc Remove BackendRepr::Uninhabited, replaced with an uninhabited: bool field in LayoutData. 2025-02-20 13:27:32 -06:00
rustc_codegen_llvm Rollup merge of #137313 - oli-obk:push-ywvuqkxuqyom, r=petrochenkov 2025-02-21 12:45:26 +01:00
rustc_codegen_ssa Refactor OperandRef::extract_field to prep for 838 2025-02-20 22:26:24 -08:00
rustc_const_eval fine-tune comment 2025-02-20 13:41:24 -06:00
rustc_data_structures Stacker now handles miri using a noop impl itself 2025-02-21 13:54:45 +00:00
rustc_driver
rustc_driver_impl Rollup merge of #137151 - Urgau:register-more-signals, r=workingjubilee 2025-02-18 18:34:14 +01:00
rustc_error_codes fix: Alloc new errorcode E0803 for E0495 2025-02-15 12:18:30 +08:00
rustc_error_messages tree-wide: parallel: Fully removed all Lrc, replaced with Arc 2025-02-03 13:25:57 +03:00
rustc_errors Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
rustc_expand Reject macro calls inside of #![crate_name] 2025-02-15 16:47:30 +01:00
rustc_feature Rollup merge of #136787 - compiler-errors:lt2024feat, r=oli-obk 2025-02-22 01:01:40 +01:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz Rustfmt 2025-02-08 22:12:13 +00:00
rustc_hashes Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
rustc_hir Move methods from Map to TyCtxt, part 2. 2025-02-18 10:17:44 +11:00
rustc_hir_analysis Rollup merge of #136787 - compiler-errors:lt2024feat, r=oli-obk 2025-02-22 01:01:40 +01:00
rustc_hir_pretty Overhaul the intravisit::Map trait. 2025-02-17 13:21:35 +11:00
rustc_hir_typeck Move methods from Map to TyCtxt, part 3. 2025-02-21 14:31:09 +11:00
rustc_incremental Move methods from Map to TyCtxt, part 2. 2025-02-18 10:17:44 +11:00
rustc_index Rustfmt 2025-02-08 22:12:13 +00:00
rustc_index_macros update rustc_index_macros feature handling 2024-12-19 20:32:12 +03:00
rustc_infer Rollup merge of #137305 - nnethercote:rustc_middle-2, r=lcnr 2025-02-21 12:45:25 +01:00
rustc_interface Move methods from Map to TyCtxt, part 2. 2025-02-18 10:17:44 +11:00
rustc_lexer Rustfmt 2025-02-08 22:12:13 +00:00
rustc_lint Rollup merge of #136787 - compiler-errors:lt2024feat, r=oli-obk 2025-02-22 01:01:40 +01:00
rustc_lint_defs Reword message 2025-02-20 17:55:31 +00:00
rustc_llvm Quote embedded codeview command line arguments 2025-02-14 11:02:28 +01:00
rustc_log Avoid naming variables str 2025-01-07 14:30:02 +02:00
rustc_macros Make fewer crates depend on rustc_ast_ir 2025-02-19 07:06:54 +00:00
rustc_metadata Move methods from Map to TyCtxt, part 2. 2025-02-18 10:17:44 +11:00
rustc_middle Rollup merge of #137257 - compiler-errors:fake-borrow-of-packed-field, r=oli-obk 2025-02-22 01:01:41 +01:00
rustc_mir_build Auto merge of #137397 - matthiaskrgr:rollup-ls2pilo, r=matthiaskrgr 2025-02-21 19:57:50 +00:00
rustc_mir_dataflow Rollup merge of #137213 - nnethercote:rm-rustc_middle-mir-tcx, r=compiler-errors 2025-02-19 01:30:13 +01:00
rustc_mir_transform Rollup merge of #137305 - nnethercote:rustc_middle-2, r=lcnr 2025-02-21 12:45:25 +01:00
rustc_monomorphize Register USAGE_OF_TYPE_IR_INHERENT, remove inherent usages 2025-02-19 07:19:27 +00:00
rustc_next_trait_solver Make sure we don't overrun the stack in canonicalizer 2025-02-21 18:24:05 +00:00
rustc_parse Rollup merge of #137281 - estebank:doc-comment-syntax-error, r=compiler-errors 2025-02-20 00:55:16 +01:00
rustc_parse_format Rustfmt 2025-02-08 22:12:13 +00:00
rustc_passes Move methods from Map to TyCtxt, part 3. 2025-02-21 14:31:09 +11:00
rustc_pattern_analysis Add pattern_complexity_limit to Limits. 2025-02-17 09:30:33 +11:00
rustc_privacy Move methods from Map to TyCtxt, part 2. 2025-02-18 10:17:44 +11:00
rustc_query_impl Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
rustc_query_system Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
rustc_resolve Auto merge of #137397 - matthiaskrgr:rollup-ls2pilo, r=matthiaskrgr 2025-02-21 19:57:50 +00:00
rustc_sanitizers check the types in ty::Value to value conversion 2025-01-30 18:13:16 +01:00
rustc_serialize Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
rustc_session Auto merge of #137164 - matthiaskrgr:rollup-dj5826k, r=matthiaskrgr 2025-02-17 11:18:33 +00:00
rustc_smir Remove BackendRepr::Uninhabited, replaced with an uninhabited: bool field in LayoutData. 2025-02-20 13:27:32 -06:00
rustc_span Restrict bevy hack 2025-02-19 03:58:31 +00:00
rustc_symbol_mangling Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
rustc_target Rollup merge of #135630 - folkertdev:s390x-target-features, r=Amanieu 2025-02-21 12:45:22 +01:00
rustc_trait_selection Rollup merge of #137245 - estebank:from-residual-note-2, r=oli-obk 2025-02-22 01:01:41 +01:00
rustc_traits Clean up dropck code a bit 2025-02-17 11:33:07 +00:00
rustc_transmute Make fewer crates depend on rustc_ast_ir 2025-02-19 07:06:54 +00:00
rustc_ty_utils Rollup merge of #137350 - nnethercote:remove-Map-3, r=Zalathar 2025-02-21 19:01:15 +01:00
rustc_type_ir Do not deduplicate list of associated types provided by dyn principal 2025-02-21 19:32:45 +00:00
rustc_type_ir_macros Make fewer crates depend on rustc_ast_ir 2025-02-19 07:06:54 +00:00
stable_mir Remove BackendRepr::Uninhabited, replaced with an uninhabited: bool field in LayoutData. 2025-02-20 13:27:32 -06:00