summaryrefslogtreecommitdiffstats
path: root/tests/ui/implied-bounds/implied-bounds-unconstrained-1.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/implied-bounds/implied-bounds-unconstrained-1.rs')
-rw-r--r--tests/ui/implied-bounds/implied-bounds-unconstrained-1.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/ui/implied-bounds/implied-bounds-unconstrained-1.rs b/tests/ui/implied-bounds/implied-bounds-unconstrained-1.rs
new file mode 100644
index 000000000..025e5176f
--- /dev/null
+++ b/tests/ui/implied-bounds/implied-bounds-unconstrained-1.rs
@@ -0,0 +1,28 @@
+// check-pass
+
+// Regression test for #112832.
+pub trait QueryDb {
+ type Db;
+}
+
+pub struct QueryTable<Q, DB> {
+ db: DB,
+ storage: Q,
+}
+
+// We normalize `<Q as QueryDb>::Db` to `<Q as AsyncQueryFunction<'d>>::SendDb`
+// using the where-bound. 'd is an unconstrained region variable which previously
+// triggered an assert.
+impl<Q> QueryTable<Q, <Q as QueryDb>::Db> where Q: for<'d> AsyncQueryFunction<'d> {}
+
+pub trait AsyncQueryFunction<'d>: QueryDb<Db = <Self as AsyncQueryFunction<'d>>::SendDb> {
+ type SendDb: 'd;
+}
+
+pub trait QueryStorageOpsAsync<Q>
+where
+ Q: for<'d> AsyncQueryFunction<'d>,
+{
+}
+
+fn main() {}