]> git.proxmox.com Git - rustc.git/blob - src/test/ui/regions/regions-bounds.rs
New upstream version 1.63.0+dfsg1
[rustc.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() { }