Skip to content

Commit bc6514e

Browse files
committed
Add a regression test for issue-70703
1 parent ecef52a commit bc6514e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/test/ui/inference/issue-70703.rs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
}

0 commit comments

Comments
 (0)