Skip to content

Commit 6d64c92

Browse files
committed
internal: init: add support for tuple struct initialisation
Refactor to parse initialiser keys as `Member` (named or tuple index). Additionally, extend init parser to support both tuple-like init constructor e.g. `Foo(a, <- b, c)` and brace syntax e.g. `Foo{0 : a, 1 <- b, 2: c}`. Signed-off-by: Mohamad Alsadhan <mo@sdhn.cc>
1 parent 51ecee3 commit 6d64c92

File tree

2 files changed

+178
-55
lines changed

2 files changed

+178
-55
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12-
- `[pin_data]` now supports tuple structs
12+
- `#[pin_data]` and `{pin_}init!` now support tuple structs.
13+
e.g. `Foo(a, <- b, c)` and brace syntax e.g. `Foo{0 : a, 1 <- b, 2: c}`.
1314
- `[pin_]init_scope` functions to run arbitrary code inside of an initializer.
1415
- `&'static mut MaybeUninit<T>` now implements `InPlaceWrite`. This enables users to use external
1516
allocation mechanisms such as `static_cell`.

0 commit comments

Comments
 (0)