rust/compiler/rustc_const_eval/src/const_eval
bors 22a7a19f93 Auto merge of #98112 - saethlin:mir-alignment-checks, r=oli-obk
Insert alignment checks for pointer dereferences when debug assertions are enabled

Closes https://github.com/rust-lang/rust/issues/54915

- [x] Jake tells me this sounds like a place to use `MirPatch`, but I can't figure out how to insert a new basic block with a new terminator in the middle of an existing basic block, using `MirPatch`. (if nobody else backs up this point I'm checking this as "not actually a good idea" because the code looks pretty clean to me after rearranging it a bit)
- [x] Using `CastKind::PointerExposeAddress` is definitely wrong, we don't want to expose. Calling a function to get the pointer address seems quite excessive. ~I'll see if I can add a new `CastKind`.~ `CastKind::Transmute` to the rescue!
- [x] Implement a more helpful panic message like slice bounds checking.

r? `@oli-obk`
2023-03-31 08:50:35 +00:00
..
error.rs rustc_const_eval: remove ref patterns (+some pattern matching imps) 2023-01-17 07:48:19 +00:00
eval_queries.rs Rename many interner functions. 2023-02-24 07:32:24 +11:00
fn_queries.rs Use local key in providers 2023-03-21 15:38:51 +00:00
machine.rs A MIR transform that checks pointers are aligned 2023-03-23 18:23:06 -04:00
mod.rs Use target instead of machine for mir interpreter integer handling. 2023-02-15 08:56:18 +00:00
valtrees.rs Update ty::VariantDef to use IndexVec<FieldIdx, FieldDef> 2023-03-30 09:23:40 -07:00