提交 c3f0aa97 编写于 作者: P Patrick Walton

test: Fix last-use-corner-cases. rs=bustage

上级 57e4ed47
......@@ -20,13 +20,13 @@ fn main() {
// But only when it really is the last use
let q = ~20;
let f = fn@() -> *int { ptr::addr_of(&(*q)) };
let f = fn@(copy q) -> *int { ptr::addr_of(&(*q)) };
assert ptr::addr_of(&(*q)) != f();
// Ensure function arguments and box arguments interact sanely.
fn call_me(x: fn() -> int, y: ~int) { assert x() == *y; }
let q = ~30;
call_me({|| *q}, q);
call_me({|copy q| *q}, q);
// Check that no false positives are found in loops.
let mut q = ~40, p = 10;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册