Add a regression test for issue-70703

This commit is contained in:
Yuki Okushi 2021-07-02 08:31:51 +09:00
parent ecef52abeb
commit bc6514e336
No known key found for this signature in database
GPG Key ID: DABA5B072961C18A

View File

@ -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(());
}