new borrowing tests (not all passing)
This commit is contained in:
parent
b3f308bec5
commit
4d73185f3e
3 changed files with 31 additions and 0 deletions
11
src/test/run-pass/regions-borrow-at.rs
Normal file
11
src/test/run-pass/regions-borrow-at.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
// xfail-test it don't work yet
|
||||
|
||||
fn foo(x: &uint) -> uint {
|
||||
*x
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let p = @3u;
|
||||
let r = foo(p);
|
||||
assert r == 3u;
|
||||
}
|
11
src/test/run-pass/regions-borrow-evec-at.rs
Normal file
11
src/test/run-pass/regions-borrow-evec-at.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
// xfail-test it don't work yet
|
||||
|
||||
fn foo(x: [uint]/&) -> uint {
|
||||
x[0]
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let p = [22u]/@;
|
||||
let r = foo(p);
|
||||
assert r == 22u;
|
||||
}
|
9
src/test/run-pass/regions-borrow-uniq.rs
Normal file
9
src/test/run-pass/regions-borrow-uniq.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
fn foo(x: &uint) -> uint {
|
||||
*x
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let p = ~3u;
|
||||
let r = foo(p);
|
||||
assert r == 3u;
|
||||
}
|
Loading…
Add table
Reference in a new issue