blob: 879f30071bfdb0e685cd70282079fe887555d5c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// check-pass
// Regression test for issue #90662
// Tests that projection caching does not cause a spurious error
trait HasProvider<T: ?Sized> {}
trait Provider<M> {
type Interface: ?Sized;
}
trait Repository {}
trait Service {}
struct DbConnection;
impl<M> Provider<M> for DbConnection {
type Interface = DbConnection;
}
struct RepositoryImpl;
impl<M: HasProvider<DbConnection>> Provider<M> for RepositoryImpl {
type Interface = dyn Repository;
}
struct ServiceImpl;
impl<M: HasProvider<dyn Repository>> Provider<M> for ServiceImpl {
type Interface = dyn Service;
}
struct TestModule;
impl HasProvider<<DbConnection as Provider<Self>>::Interface> for TestModule {}
impl HasProvider<<RepositoryImpl as Provider<Self>>::Interface> for TestModule {}
impl HasProvider<<ServiceImpl as Provider<Self>>::Interface> for TestModule {}
fn main() {}
|