keep self call is refused only by rustcOpen and answer this issue on GitHub.
ready · opened 2026-11-04 · updated 2026-11-04 · 0 comments
The checker does not refuse a use of a value after a keep self method consumed it, nor self.part.into_x() (a keep self method on a field) inside a ref self method. Only rustc refuses these, with its own message (“Use of moved value: b”), so nikaia check passes a program that nikaia run then refuses, and nikaia test counts it as a failed build, not a refusal.
Probe (nikaia check passes; should be refused with an NK code and a help):
struct Box { name: String }
impl Box {
fn take(keep self) -> String { return self.name }
}
fn main() {
let b = Box { name: "hi" }
println(b.take())
println(b.take())
}
keep self call (the existing use-after-move code, if one fits; else a new code from the supervisor), and a keep self call on a field of a lent self.tests/compiler/ with .stderr: both cases refused, and one call followed by no use still runs.Part of #1213.
Generated by Claude Code