-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #92041 - Aaron1011:remove-speculative-evaluation, r=jac…
…kh726 Remove 'speculative evaluation' of predicates Performing 'speculative evaluation' introduces caching bugs that cannot be fixed without invasive changes to projection. Hopefully, we can win back most of the performance lost by re-adding 'cache completion' Fixes #90662
- Loading branch information
Showing
2 changed files
with
35 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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() {} |