]> git.lizzy.rs Git - rust.git/blob - tests/ui/inference/issue-70703.rs
Rollup merge of #106869 - notriddle:notriddle/item-decl-pre-rust, r=GuillaumeGomez
[rust.git] / tests / ui / inference / issue-70703.rs
1 // check-pass
2
3 trait Factory {
4     type Product;
5 }
6
7 impl Factory for () {
8     type Product = ();
9 }
10
11 trait ProductConsumer<P> {
12     fn consume(self, product: P);
13 }
14
15 impl<P> ProductConsumer<P> for () {
16     fn consume(self, _: P) {}
17 }
18
19 fn make_product_consumer<F: Factory>(_: F) -> impl ProductConsumer<F::Product> {
20     ()
21 }
22
23 fn main() {
24     let consumer = make_product_consumer(());
25     consumer.consume(());
26 }