From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/traits/issue-90662-projection-caching.rs | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/test/ui/traits/issue-90662-projection-caching.rs (limited to 'src/test/ui/traits/issue-90662-projection-caching.rs') diff --git a/src/test/ui/traits/issue-90662-projection-caching.rs b/src/test/ui/traits/issue-90662-projection-caching.rs new file mode 100644 index 000000000..879f30071 --- /dev/null +++ b/src/test/ui/traits/issue-90662-projection-caching.rs @@ -0,0 +1,34 @@ +// check-pass + +// Regression test for issue #90662 +// Tests that projection caching does not cause a spurious error + +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() {} -- cgit v1.2.3