Files
Jacob Pratt 91fc16bab6 Rollup merge of #158796 - raushan728:issues/154044, r=saethlin
Distinguish null reference production from null pointer dereference in UB checks

Closes rust-lang/rust#154044

This change distinguishes null reference production from actual null pointer dereferences in the UB checks.

Producing a reference from a null pointer (for example, `&*ptr`) is undefined behavior even if no memory is dereferenced. This change introduces a dedicated `AssertKind::NullReferenceConstructed` and runtime panic so these cases produce a more accurate diagnostic while preserving the existing panic for actual null pointer dereferences.

Summary
- Add `AssertKind::NullReferenceConstructed`.
- Emit it for null reference production in the MIR null check pass.
- Add `panic_null_reference_constructed` and its lang item.
- Keep `NullPointerDereference` for actual dereferences.
- Update the affected UI tests.
2026-07-06 22:17:40 -04:00
..
2026-06-24 23:18:10 +01:00