about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/check_null.rs
AgeCommit message (Collapse)AuthorLines
2025-06-29mir: Add a `new` method to `statement`dianqk-18/+17
Avoid introducing a large number of changes when adding optional initialization fields.
2025-04-25Extend the alignment check to borrowsBastian Kersting-2/+8
The current alignment check does not include checks for creating misaligned references from raw pointers, which is now added in this patch. When inserting the check we need to be careful with references to field projections (e.g. `&(*ptr).a`), in which case the resulting reference must be aligned according to the field type and not the type of the pointer.
2025-02-08Detect (non-raw) borrows of null ZST pointers in CheckNullMichael Goulet-23/+46
2025-01-31Insert null checks for pointer dereferences when debug assertions are enabledBastian Kersting-0/+110
Similar to how the alignment is already checked, this adds a check for null pointer dereferences in debug mode. It is implemented similarly to the alignment check as a MirPass. This is related to a 2025H1 project goal for better UB checks in debug mode: https://github.com/rust-lang/rust-project-goals/pull/177.