Rollup merge of #86796 - JohnTitor:test-70703, r=jonas-schievink
Add a regression test for issue-70703 Closes #70703
This commit is contained in:
commit
f6ef2c8cbe
1 changed files with 26 additions and 0 deletions
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…
Add table
Reference in a new issue