Repository navigation
Conversation
Rua
force-pushed
the
unsafe-expr-wrapper
branch
from
September 16, 2026 17:41
ced2f5c to
180d836
Compare
Rua
force-pushed
the
unsafe-expr-wrapper
branch
from
September 16, 2026 18:22
180d836 to
d5249fb
Compare
Rua
marked this pull request as draft
September 26, 2026 19:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unlike
WithStmts, this doesn't contain any statements, but represents an expression alone. I've made it the return type of any functions that return an unsafe expression (notably,transmute_expr), and refactored all the call sites around the new return type. I've also added aFlattenabletrait which makes things likeand_thenmore generic; the genericised version is namedflat_mapand is implemented forWithStmtstoo.My intent here is for
WithStmtsto eventually lose itsis_unsafefield altogether, and forWithStmts<Tagged<T>>to be used instead in that role. I haven't done that here, as it will require more refactoring throughout the codebase.The name
Taggedis not particularly great, I'll admit. But I couldn't really come up with anything better at the moment. I considered naming itSafety,UnsafeorMaybeUnsafe, but that ties it too strongly to that particular function. It's possible that more fields could be added to it later, if anyone thinks of any. (Edit: just thought of another potential use, indicating whether the expression has side effects)