You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Combining place projections in MIR makes codegen forget that NonNull is nonnull #111518
In #105808 I am adding a hack to prevent combining place projections where one of assignments that would be optimized away contains a niche. This is because optimizing Vec::as_ptr to a single MIR statement that just loads the underlying *const T makes us lose the nonnull LLVM attribute in codegen.
(I am opening this issue early so I can link to it in the PR)
So maybe we should use the same approach that repr(simd) is moving towards: just disallow place projections to the inner field entirely for such types. That makes this issue irrelevant -- as the project isn't there to be combined -- and the niche support ends up in the transmutes and such instead, where it sees the different types properly instead of just projections.
Activity
scottmcm commentedon May 12, 2023
The reminds me of why I dislike the "it's just a field" approach in the first place (and thus I dislike rust-lang/rfcs#3334), and reminds me of similar problems that
repr(simd)hit with looking at fields (see https://rust-lang.zulipchat.com/#narrow/stream/257879-project-portable-simd/topic/splat.20no.20longer.20compiles.20for.20release.20builds/near/351948961).So maybe we should use the same approach that
repr(simd)is moving towards: just disallow place projections to the inner field entirely for such types. That makes this issue irrelevant -- as the project isn't there to be combined -- and the niche support ends up in the transmutes and such instead, where it sees the different types properly instead of just projections.