Closed
Description
Currently, the incoming branch rustc accepts the following program:
fn dup(x: ~int) -> (~int,~int) { *~(x,x) }
fn main() { dup(~2); }
Since dup
duplicates a unique pointer, it shouldn't accept it. Indeed, it correctly rejects the following program, complaining that it uses a moved variable:
fn dup(x: ~int) -> (~int,~int) { *~(move x,move x) }
fn main() { dup(~2); }
This makes me think that the problem is somewhere in the code @pcwalton added in #4109, @33c1e47.
Note that the following is also accepted incorrectly:
fn dup(x: ~int) -> ~(~int,~int) { ~(x,x) }
However, the following is correctly rejected:
fn dup(x: ~int) -> (~int,~int) { (x,x) }
Metadata
Metadata
Assignees
Labels
No labels