Skip to content

Conversation

BennoLossin
Copy link
Member

No description provided.

@BennoLossin BennoLossin force-pushed the dev/init-scope branch 5 times, most recently from 91f324f to 7f2ed79 Compare October 9, 2025 12:38
@BennoLossin
Copy link
Member Author

@dakr @Darksonn if you could do the review here already that would help me a bit with synchronizing to the kernel.

nbdd0121
nbdd0121 previously approved these changes Oct 9, 2025
Copy link
Member

@nbdd0121 nbdd0121 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Feel free to add my Reviewed-by when sending to the list

Copy link
Member

@dakr dakr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the comments addressed:

Reviewed-by: Danilo Krummrich [email protected]

Copy link
Member

@dakr dakr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the comments addressed:

Reviewed-by: Danilo Krummrich [email protected]

In more complex cases, initializers need to run arbitrary code before
assigning initializers to fields. While this is possible using the
underscore codeblock feature (`_: {}`), values returned by such
functions cannot be used from later field initializers.

The two new functinos `[pin_]init_scope` allow users to first run some
fallible code and then return an initializer which the function turns
into a single initializer. This permits using the same value multiple
times by different fields.

Reviewed-by: Gary Guo <[email protected]>
Reviewed-by: Danilo Krummrich [email protected]
Signed-off-by: Benno Lossin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants