v3: ownership fixes - #28046
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Reviewed PR #28046, “v3: ownership fixes,” at head [P1] Preserve pending siblings in the iterative annotation walkLocation:
mut pending := [id]
for pending.len > 0 {
current_id := pending.pop()
...
match node.kind {
.decl_assign {
...
return
}
.for_in_stmt {
...
return
}
.call {
...
return
}
...
}
}Under the old recursive implementation, those returns only completed annotation of the current child; the caller’s child loop then continued. In the new implementation, they terminate the entire For example, when annotating a block like: fn example() {
value := create_value()
consume(value)
println(value)
}the block pushes all three statements. Processing the first The stack-loop-local exits should be [P2] Do not bypass expected-type conversion for ordinary
|
Fixes to the V3 compiler's ownership system.
ownership_type_has_clone_methodto the always-built checker surface, detecting types that declare a handwrittenclonemethod (including generic-struct methods). Ownership transform support is compiled intoveven whenvitself is built without ownership, so this lookup cannot live behind$if ownership.IClonereceivers (no declaredclonemethod) from types that provide a realclone, so generic clone lowering selects the correct path.cur_mut_pointer_params,current_param_is_mut_pointer,selector_base_is_local_value) so explicitly pointer-typedmut x &Tparameters retain pointer semantics instead of being treated as valuemutparams.