]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-87258_b.rs
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / ui / generic-associated-types / issue-87258_b.rs
1 #![feature(type_alias_impl_trait)]
2 #![feature(generic_associated_types)]
3
4 // See https://github.com/rust-lang/rust/issues/87258#issuecomment-883293367
5
6 trait Trait1 {}
7
8 struct Struct<'b>(&'b ());
9
10 impl<'d> Trait1 for Struct<'d> {}
11
12 pub trait Trait2 {
13     type FooFuture<'a>: Trait1;
14     fn foo<'a>() -> Self::FooFuture<'a>;
15 }
16
17 type Helper<'xenon, 'yttrium, KABOOM: Trait2> = impl Trait1;
18 //~^ ERROR unconstrained opaque type
19
20 impl<'c, S: Trait2> Trait2 for &'c mut S {
21     type FooFuture<'a> = Helper<'c, 'a, S>;
22     fn foo<'a>() -> Self::FooFuture<'a> {
23         Struct(unimplemented!())
24     }
25 }
26
27 fn main() {}