]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/issue-59324.rs
Auto merge of #106143 - matthiaskrgr:rollup-3kpy1dc, r=matthiaskrgr
[rust.git] / src / test / ui / associated-types / issue-59324.rs
1 trait NotFoo {}
2
3 pub trait Foo: NotFoo {
4     type OnlyFoo;
5 }
6
7 pub trait Service {
8     type AssocType;
9 }
10
11 pub trait ThriftService<Bug: NotFoo>:
12 //~^ ERROR the trait bound `Bug: Foo` is not satisfied
13 //~| ERROR the trait bound `Bug: Foo` is not satisfied
14     Service<AssocType = <Bug as Foo>::OnlyFoo>
15 {
16     fn get_service(
17     //~^ ERROR the trait bound `Bug: Foo` is not satisfied
18     //~| ERROR the trait bound `Bug: Foo` is not satisfied
19         &self,
20     ) -> Self::AssocType;
21 }
22
23 fn with_factory<H>(factory: dyn ThriftService<()>) {}
24 //~^ ERROR the trait bound `(): Foo` is not satisfied
25
26 fn main() {}