]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-bounds.rs
Rollup merge of #106043 - c410-f3r:moar-errors, r=petrochenkov
[rust.git] / src / test / ui / regions / regions-bounds.rs
1 // Check that explicit region bounds are allowed on the various
2 // nominal types (but not on other types) and that they are type
3 // checked.
4
5 struct TupleStruct<'a>(&'a isize);
6 struct Struct<'a> { x:&'a isize }
7
8 fn a_fn1<'a,'b>(e: TupleStruct<'a>) -> TupleStruct<'b> {
9     return e;
10     //~^ ERROR lifetime may not live long enough
11 }
12
13 fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> {
14     return e;
15     //~^ ERROR lifetime may not live long enough
16 }
17
18 fn main() { }