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
Some of the things we want people to do with Rust can currently not be expressed in LLVM in a way that is fully backed by the LLVM LangRef.
2
+
Let's collect a list of those cases here.
3
+
4
+
## List of LLVM assumptions not backed by the spec
5
+
6
+
- To implement `ptr.addr()`, we assume that a pointer-to-int transmute yields the address.
7
+
The LangRef is quiet about this (as it is about almost everything related to provenance).
8
+
Alive says that this yields poison.
9
+
- To implement the desired semantics for `MaybeUninit<$int>` we need a type of arbitrary size that can hold arbitrary data -- including provenance.
10
+
LLVM currently has no such type, the only type that is fully guaranteed to support provenance is `ptr` and that has a fixed size.
11
+
- This one is not about current Rust but about possible future extensions:
12
+
when LLVM returns `poison` for some operation, we can *not* say that this corresponds to `uninit` in Rust. We *must* declare this immediate UB.
13
+
The reason for this is that LLVM does not really support `poison` being stored in memory; Rust's `uninit` can therefore only correspond to LLVM's `undef`.
0 commit comments