-
Couldn't load subscription status.
- Fork 13.9k
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 typeviolates 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_voids 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 useopaquetype in LLVM #59095.
RESOLVED because all pointer types areptrnow. -
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
externtypes) #115709 -
How should we model
mem::size_of::<ExternType>()? Tracked in Tracking Issue for Sized Hierarchy #144404.