about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorUrgau <3616612+Urgau@users.noreply.github.com>2025-02-09 00:37:28 +0100
committerGitHub <noreply@github.com>2025-02-09 00:37:28 +0100
commite5bc12e4a396e36c89ff4cdaf8d85a37f36e378a (patch)
treee65839e82816f34ea50ab3a7037d23864ae3de03 /compiler/rustc_interface/src
parentd024cef0577ad6f3e370dfc3d5befe47695235b8 (diff)
parenta61537f6c068eab87c79173c23837d74b7f7d0ef (diff)
downloadrust-e5bc12e4a396e36c89ff4cdaf8d85a37f36e378a.tar.gz
rust-e5bc12e4a396e36c89ff4cdaf8d85a37f36e378a.zip
Rollup merge of #136601 - compiler-errors:borrow-null-zst, r=saethlin
Detect (non-raw) borrows of null ZST pointers in CheckNull

Fixes #136568. Ensures that we check that borrows of derefs are non-null in the `CheckNull` pass **even if** it's a ZST pointee.

I'm actually surprised that this is UB in Miri, but if it's certainly UB, then this PR modifies the null check to be stricter. I couldn't find anywhere in https://doc.rust-lang.org/reference/behavior-considered-undefined.html that discusses this case specifically, but I didn't read it too closely, or perhaps it's just missing a bullet point.

On the contrary, if this is actually erroneous UB in Miri, then I'm happy to close this (and perhaps fix the null check in Miri to exclude ZSTs?)

On the double contrary, if this is still an "open question", I'm also happy to close this and wait for a decision to be made.

r? ``@saethlin`` cc ``@RalfJung`` (perhaps you feel strongly about this change)
Diffstat (limited to 'compiler/rustc_interface/src')
0 files changed, 0 insertions, 0 deletions