derive_dst 0.1.0

Derive macro for DST structs: generates a private `UninitFoo` MaybeUninit mirror, safe allocation constructors (`new_uninit_for_size` / `new_uninit_for_count` returning the box with its `Layout`, tail offset & count), an unsafe `assume_init`, and layout constructors (`layout_for_size` / `layout_for_count`) returning `LayoutError`. Requires nightly.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
error: DST can only be derived for a struct with named fields
 --> tests/compilation/fail_TupleStruct.rs:7:10
  |
7 | #[derive(DST)]
  |          ^^^
  |
help: tuple structs are not supported
 --> tests/compilation/fail_TupleStruct.rs:8:19
  |
8 | struct TupleStruct(u32, [u16]);
  |                   ^^^^^^^^^^^^
  = note: this error originates in the derive macro `DST` (in Nightly builds, run with -Z macro-backtrace for more info)