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