Conversation
6 tasks
Deploying nulang-docs with
|
| Latest commit: |
a46f70f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5a106f44.nulang-docs.pages.dev |
| Branch Preview URL: | https://feat-ownership-moveout-drop.nulang-docs.pages.dev |
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.
Summary
Implements #402 Phase 1 on top of #401.
consume xno longer relies on an incidental compiler pattern equivalent to:Ownership transfer is now explicit in the non-serialized compiler IR:
This makes "copy" and "transfer" distinct facts for later ownership/drop analysis without changing the frozen bytecode artifact format.
Backend semantics
Bytecode / VM
MoveOut(src)lowers using existing instructions:Move src, dst;Nilconstant intosrc.No new opcode and no NBC format change.
WASM
The original source value is left on the operand stack for the destination assignment, then the source local is set to tagged Nil.
Native AOT
Cranelift uses the existing source SSA value as the result, then removes the source register from
local_valsbefore binding the destination. AOT liveness also treats MoveOut as read-then-kill so pre-move values are not threaded through continuations.CIR / inliner
MoveOut remains a distinct MIR operation through remapping; CIR reads the source value while static ownership analysis guarantees source unavailability afterwards.
Optimizer / drop planner
This avoids the unsafe shortcut of treating capability metadata alone as proof of runtime ownership.
Tests
consume xproduces MoveOut and no separatex = nilstatement.Stack
Not included
Keep draft until exact-head Rust, WASM, AOT/release, lint, and no-default-feature validation is terminal.