Open matthiaskrgr opened 4 years ago
Lint pass "assumes all code will be executed". This particular division is preceded by an assert and as a result it is unreachable:
Yeah, I don't think there's anything actionable here.
The offset_from
itself is referenced from size_hint
but again protected by ZST check, so neither is there an issue at Rust level:
Couldn't we just emit a constant like 0 or isize::MIN
for ZST intrinsics::ptr_offset_from
? Sure it's unreachable, but we might as well give LLVM something trivial to optimize away, rather than an instruction that will trigger lints.
This code from
src/test/ui/issues/issue-49685.rs
Causes the following llvm lint message
when checked with
./build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/test/ui/issues/issue-49685.rs -Cpasses=lint
repo @ 2342cc33333d0e87f692cf0b95b762743c74324d