From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/inference/issue-70703.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/ui/inference/issue-70703.rs (limited to 'tests/ui/inference/issue-70703.rs') diff --git a/tests/ui/inference/issue-70703.rs b/tests/ui/inference/issue-70703.rs new file mode 100644 index 000000000..d90498e96 --- /dev/null +++ b/tests/ui/inference/issue-70703.rs @@ -0,0 +1,26 @@ +// check-pass + +trait Factory { + type Product; +} + +impl Factory for () { + type Product = (); +} + +trait ProductConsumer

{ + fn consume(self, product: P); +} + +impl

ProductConsumer

for () { + fn consume(self, _: P) {} +} + +fn make_product_consumer(_: F) -> impl ProductConsumer { + () +} + +fn main() { + let consumer = make_product_consumer(()); + consumer.consume(()); +} -- cgit v1.2.3