2012-05-21 15:05:06 -05:00
|
|
|
// Should fail region checking, because g can only accept a pointer
|
|
|
|
// with lifetime r, and a is a pointer with unspecified lifetime.
|
|
|
|
fn not_ok_1(a: &uint) {
|
|
|
|
let mut g: fn@(x: &uint) = fn@(x: &r.uint) {};
|
2012-06-30 06:23:59 -05:00
|
|
|
//~^ ERROR mismatched types
|
2012-05-21 15:05:06 -05:00
|
|
|
g(a);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Should fail region checking, because g can only accept a pointer
|
|
|
|
// with lifetime r, and a is a pointer with lifetime s.
|
|
|
|
fn not_ok_2(s: &s.uint)
|
|
|
|
{
|
|
|
|
let mut g: fn@(x: &uint) = fn@(x: &r.uint) {};
|
2012-06-30 06:23:59 -05:00
|
|
|
//~^ ERROR mismatched types
|
2012-05-21 15:05:06 -05:00
|
|
|
g(s);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|
|
|
|
|
|
|
|
|