]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-bounds.rs
Rollup merge of #97317 - GuillaumeGomez:gui-settings-text-click, r=jsha
[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 // revisions: base nll
6 // ignore-compare-mode-nll
7 //[nll] compile-flags: -Z borrowck=mir
8
9 struct TupleStruct<'a>(&'a isize);
10 struct Struct<'a> { x:&'a isize }
11
12 fn a_fn1<'a,'b>(e: TupleStruct<'a>) -> TupleStruct<'b> {
13     return e;
14     //[base]~^ ERROR mismatched types
15     //[nll]~^^ ERROR lifetime may not live long enough
16 }
17
18 fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> {
19     return e;
20     //[base]~^ ERROR mismatched types
21     //[nll]~^^ ERROR lifetime may not live long enough
22 }
23
24 fn main() { }