summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/non_lifetime_binders/disqualifying-object-candidates.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/non_lifetime_binders/disqualifying-object-candidates.rs')
-rw-r--r--tests/ui/traits/non_lifetime_binders/disqualifying-object-candidates.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/traits/non_lifetime_binders/disqualifying-object-candidates.rs b/tests/ui/traits/non_lifetime_binders/disqualifying-object-candidates.rs
new file mode 100644
index 000000000..b999f251d
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/disqualifying-object-candidates.rs
@@ -0,0 +1,19 @@
+// check-pass
+
+trait Foo {
+ type Bar<T>
+ where
+ dyn Send + 'static: Send;
+}
+
+impl Foo for () {
+ type Bar<T> = i32;
+ // We take `<() as Foo>::Bar<T>: Sized` and normalize it under the where clause
+ // of `for<S> <() as Foo>::Bar<S> = i32`. This gives us back `i32: Send` with
+ // the nested obligation `(dyn Send + 'static): Send`. However, during candidate
+ // assembly for object types, we disqualify any obligations that has non-region
+ // late-bound vars in the param env(!), rather than just the predicate. This causes
+ // the where clause to not hold even though it trivially should.
+}
+
+fn main() {}