]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/issues/issue-88236-2.rs
Auto merge of #96711 - emilio:inline-slice-clone, r=nikic
[rust.git] / src / test / ui / impl-trait / issues / issue-88236-2.rs
1 // this used to cause stack overflows
2
3 trait Hrtb<'a> {
4     type Assoc;
5 }
6
7 impl<'a> Hrtb<'a> for () {
8     type Assoc = ();
9 }
10
11 impl<'a> Hrtb<'a> for &'a () {
12     type Assoc = ();
13 }
14
15 fn make_impl() -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {}
16 //~^ ERROR higher kinded lifetime bounds on nested opaque types are not supported yet
17
18 fn make_weird_impl<'b>(x: &'b ()) -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {
19     //~^ ERROR higher kinded lifetime bounds on nested opaque types are not supported yet
20     &()
21 }
22
23 fn make_bad_impl<'b>(x: &'b ()) -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {
24     //~^ ERROR higher kinded lifetime bounds on nested opaque types are not supported yet
25     x
26 }
27
28 fn main() {}