4e03112141
This is intended to solve the problem of how to pass arguments to constructor functions -- you want to move in rvalues, but not have to explicitly copy stuff that is not an rvalue. The by-copy passing convention will ensure the callee gets its own copy of the value. For rvalues, it'll just pass off the value. For lvalues, it'll make a copy. Issue #1177
9 lines
171 B
Rust
9 lines
171 B
Rust
fn magic(+x: {a: @int}) { log x; }
|
|
fn magic2(+x: @int) { log x; }
|
|
|
|
fn main() {
|
|
let a = {a: @10}, b = @10;
|
|
magic(a); magic({a: @20});
|
|
magic2(b); magic2(@20);
|
|
}
|