Description
This is a tracking issue for RFC 1861 "Extern types".
Steps:
- Implement the RFC (Implement RFC 1861: Extern types #44295)
- Adjust documentation (see instructions on forge)
- Stabilization PR (see instructions on forge)
Unresolved questions:
-
Rust does not support types that don't have dynamically computed alignment -- we need the alignment to compute the field offset in structs.
extern type
violates this basic assumption, causing pain, suffering, and ICEs all over the compiler. What is the principled fix for this? -
Should we allow generic lifetime and type parameters on extern types?
If so, how do they effect the type in terms of variance? -
In std's source, it is mentioned that LLVM expects
i8*
for C'svoid*
.
We'd need to continue to hack this for the twoc_void
s in std and libc.
But perhaps this should be done across-the-board for all extern types?
Somebody should check what Clang does. Also see "extern type" should useopaque
type in LLVM #59095.
RESOLVED because all pointer types areptr
now. -
How should this interact with unsized arguments? Currently it ICEs: unsized_fn_params should not accept types that don't have a dynamically fixed size (such as
extern
types) #115709