]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-bounds.rs
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[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; //~ ERROR mismatched types
10 }
11
12 fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> {
13     return e; //~ ERROR mismatched types
14 }
15
16 fn main() { }