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) {
|
2012-07-12 11:36:56 -05:00
|
|
|
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.
|
2012-07-12 11:36:56 -05:00
|
|
|
fn not_ok_2(s: &s/uint)
|
2012-05-21 15:05:06 -05:00
|
|
|
{
|
2012-07-12 11:36:56 -05:00
|
|
|
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() {
|
|
|
|
}
|
|
|
|
|
|
|
|
|