mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-22 04:34:51 +00:00
Add a regression test for issue-70703
This commit is contained in:
parent
ecef52abeb
commit
bc6514e336
26
src/test/ui/inference/issue-70703.rs
Normal file
26
src/test/ui/inference/issue-70703.rs
Normal 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(());
|
||||
}
|
Loading…
Reference in New Issue
Block a user