rust/src/test/run-pass/unique-kinds.rs
2011-09-22 15:28:49 -07:00

59 lines
743 B
Rust

fn unique() {
fn f<~T>(i: T, j: T) {
assert i == j;
}
fn g<~T>(i: T, j: T) {
assert i != j;
}
let i = ~100;
let j = ~100;
f(i, j);
let i = ~100;
let j = ~101;
g(i, j);
}
fn shared() {
fn f<@T>(i: T, j: T) {
assert i == j;
}
fn g<@T>(i: T, j: T) {
assert i != j;
}
let i = ~100;
let j = ~100;
f(i, j);
let i = ~100;
let j = ~101;
g(i, j);
}
fn pinned() {
fn f<T>(i: T, j: T) {
assert i == j;
}
fn g<T>(i: T, j: T) {
assert i != j;
}
let i = ~100;
let j = ~100;
f(i, j);
let i = ~100;
let j = ~101;
g(i, j);
}
fn main() {
unique();
shared();
pinned();
}