2012-04-24 22:52:52 +00:00
|
|
|
// Check that explicit region bounds are allowed on the various
|
|
|
|
// nominal types (but not on other types) and that they are type
|
|
|
|
// checked.
|
|
|
|
|
2018-12-17 03:21:47 +00:00
|
|
|
struct TupleStruct<'a>(&'a isize);
|
|
|
|
struct Struct<'a> { x:&'a isize }
|
2012-04-24 22:52:52 +00:00
|
|
|
|
2018-12-17 03:21:47 +00:00
|
|
|
fn a_fn1<'a,'b>(e: TupleStruct<'a>) -> TupleStruct<'b> {
|
2022-04-19 10:56:18 +00:00
|
|
|
return e;
|
2022-04-01 17:13:25 +00:00
|
|
|
//~^ ERROR lifetime may not live long enough
|
2012-04-24 22:52:52 +00:00
|
|
|
}
|
|
|
|
|
2018-12-17 03:21:47 +00:00
|
|
|
fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> {
|
2022-04-19 10:56:18 +00:00
|
|
|
return e;
|
2022-04-01 17:13:25 +00:00
|
|
|
//~^ ERROR lifetime may not live long enough
|
2012-04-24 22:52:52 +00:00
|
|
|
}
|
|
|
|
|
2012-08-15 01:17:18 +00:00
|
|
|
fn main() { }
|