// revisions: old next //[next] compile-flags: -Znext-solver=coherence // check-pass // Regression test for issue #90662 // Tests that projection caching does not cause a spurious error. // Coherence relies on the following overflowing goal to still constrain // `?0` to `dyn Service`. // // Projection(>::Interface. ?0) // // cc https://github.com/rust-lang/trait-system-refactor-initiative/issues/70. trait HasProvider {} trait Provider { type Interface: ?Sized; } trait Repository {} trait Service {} struct DbConnection; impl Provider for DbConnection { type Interface = DbConnection; } struct RepositoryImpl; impl> Provider for RepositoryImpl { type Interface = dyn Repository; } struct ServiceImpl; impl> Provider for ServiceImpl { type Interface = dyn Service; } struct TestModule; impl HasProvider<>::Interface> for TestModule {} impl HasProvider<>::Interface> for TestModule {} impl HasProvider<>::Interface> for TestModule {} fn main() {}