about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-10-26 17:38:04 +0000
committerMichael Goulet <michael@errs.io>2024-10-26 17:38:08 +0000
commit6ab87f82384d0265b486ba2aa41dcf942bd42c4f (patch)
treeb1d8bc5d6003a0e920632991da6a88214402fe5c /tests
parent9260be36b2dbd896c6b233d60d1c429a75a0081a (diff)
downloadrust-6ab87f82384d0265b486ba2aa41dcf942bd42c4f.tar.gz
rust-6ab87f82384d0265b486ba2aa41dcf942bd42c4f.zip
Collect item bounds for RPITITs from trait where clauses just like associated types
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/associated-type-bounds/implied-from-self-where-clause.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/associated-type-bounds/implied-from-self-where-clause.rs b/tests/ui/associated-type-bounds/implied-from-self-where-clause.rs
new file mode 100644
index 00000000000..38f55696914
--- /dev/null
+++ b/tests/ui/associated-type-bounds/implied-from-self-where-clause.rs
@@ -0,0 +1,21 @@
+// Make sure that, like associated type where clauses on traits, we gather item
+// bounds for RPITITs from RTN where clauses.
+
+//@ check-pass
+
+#![feature(return_type_notation)]
+
+trait Foo
+where
+    Self::method(..): Send,
+{
+    fn method() -> impl Sized;
+}
+
+fn is_send(_: impl Send) {}
+
+fn test<T: Foo>() {
+    is_send(T::method());
+}
+
+fn main() {}