2012-05-21 13:05:06 -07: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) {
|
2012-07-12 09:36:56 -07:00
|
|
|
let mut g: fn@(x: &uint) = fn@(x: &r/uint) {};
|
2012-06-30 12:23:59 +01:00
|
|
|
//~^ ERROR mismatched types
|
2012-05-21 13:05:06 -07: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.
|
2012-07-12 09:36:56 -07:00
|
|
|
fn not_ok_2(s: &s/uint)
|
2012-05-21 13:05:06 -07:00
|
|
|
{
|
2012-07-12 09:36:56 -07:00
|
|
|
let mut g: fn@(x: &uint) = fn@(x: &r/uint) {};
|
2012-06-30 12:23:59 +01:00
|
|
|
//~^ ERROR mismatched types
|
2012-05-21 13:05:06 -07:00
|
|
|
g(s);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|
|
|
|
|
|
|
|
|