diff options
Diffstat (limited to 'src/test/run-pass/func-arg-ref-pattern.rs')
| -rw-r--r-- | src/test/run-pass/func-arg-ref-pattern.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/test/run-pass/func-arg-ref-pattern.rs b/src/test/run-pass/func-arg-ref-pattern.rs index 11df22d7433..bb4be948a5e 100644 --- a/src/test/run-pass/func-arg-ref-pattern.rs +++ b/src/test/run-pass/func-arg-ref-pattern.rs @@ -10,25 +10,26 @@ // exec-env:RUST_POISON_ON_FREE=1 -// Test argument patterns where we create refs to the inside of `~` +// Test argument patterns where we create refs to the inside of // boxes. Make sure that we don't free the box as we match the // pattern. -fn getaddr(~ref x: ~uint) -> *uint { + +fn getaddr(box ref x: Box<uint>) -> *uint { let addr: *uint = &*x; addr } -fn checkval(~ref x: ~uint) -> uint { +fn checkval(box ref x: Box<uint>) -> uint { *x } pub fn main() { - let obj = ~1; + let obj = box 1; let objptr: *uint = &*obj; let xptr = getaddr(obj); assert_eq!(objptr, xptr); - let obj = ~22; + let obj = box 22; assert_eq!(checkval(obj), 22); } |
