2012-08-09 09:59:50 -07:00
|
|
|
struct invariant {
|
2012-09-07 14:50:47 -07:00
|
|
|
f: @mut &int
|
2012-08-09 09:59:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
fn to_same_lifetime(bi: invariant/&r) {
|
|
|
|
let bj: invariant/&r = bi;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn to_shorter_lifetime(bi: invariant/&r) {
|
|
|
|
let bj: invariant/&blk = bi; //~ ERROR mismatched types
|
|
|
|
}
|
|
|
|
|
|
|
|
fn to_longer_lifetime(bi: invariant/&r) -> invariant/&static {
|
|
|
|
bi //~ ERROR mismatched types
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|