]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-87258_a.rs
Rollup merge of #102954 - GuillaumeGomez:cfg-hide-attr-checks, r=Manishearth
[rust.git] / src / test / ui / generic-associated-types / issue-87258_a.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 impl<'c, S: Trait2> Trait2 for &'c mut S {
17     type FooFuture<'a> = impl Trait1;
18     //~^ ERROR unconstrained opaque type
19     fn foo<'a>() -> Self::FooFuture<'a> {
20         Struct(unimplemented!())
21     }
22 }
23
24 fn main() {}