diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2021-07-03 03:15:11 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-03 03:15:11 +0900 |
| commit | f6ef2c8cbed2c119a2b7cc81baee52a4256b09bf (patch) | |
| tree | 5831b275768240f74837eeb5fc87f2e421cb0f57 /src | |
| parent | 7fb3c29dc63fd0fcbb5c3698a6d0e4951452e671 (diff) | |
| parent | bc6514e336f6971a6d05c6ae987d60e24dbf6db0 (diff) | |
| download | rust-f6ef2c8cbed2c119a2b7cc81baee52a4256b09bf.tar.gz rust-f6ef2c8cbed2c119a2b7cc81baee52a4256b09bf.zip | |
Rollup merge of #86796 - JohnTitor:test-70703, r=jonas-schievink
Add a regression test for issue-70703 Closes #70703
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/inference/issue-70703.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/ui/inference/issue-70703.rs b/src/test/ui/inference/issue-70703.rs new file mode 100644 index 00000000000..d90498e96ea --- /dev/null +++ b/src/test/ui/inference/issue-70703.rs @@ -0,0 +1,26 @@ +// check-pass + +trait Factory { + type Product; +} + +impl Factory for () { + type Product = (); +} + +trait ProductConsumer<P> { + fn consume(self, product: P); +} + +impl<P> ProductConsumer<P> for () { + fn consume(self, _: P) {} +} + +fn make_product_consumer<F: Factory>(_: F) -> impl ProductConsumer<F::Product> { + () +} + +fn main() { + let consumer = make_product_consumer(()); + consumer.consume(()); +} |
