rust/src/test/compile-fail/regions-trait-3.rs

15 lines
359 B
Rust
Raw Normal View History

trait get_ctxt {
fn get_ctxt() -> &self/uint;
}
fn make_gc1(gc: get_ctxt/&a) -> get_ctxt/&b {
2012-08-01 19:30:05 -05:00
return gc; //~ ERROR mismatched types: expected `get_ctxt/&b` but found `get_ctxt/&a`
}
fn make_gc2(gc: get_ctxt/&a) -> get_ctxt/&b {
2012-08-01 19:30:05 -05:00
return gc as get_ctxt; //~ ERROR mismatched types: expected `get_ctxt/&b` but found `get_ctxt/&a`
}
fn main() {
}