We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7fb3c29 + bc6514e commit f6ef2c8Copy full SHA for f6ef2c8
src/test/ui/inference/issue-70703.rs
@@ -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