summaryrefslogtreecommitdiffstats
path: root/src/test/ui/generic-associated-types/collectivity-regression.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/generic-associated-types/collectivity-regression.rs')
-rw-r--r--src/test/ui/generic-associated-types/collectivity-regression.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/generic-associated-types/collectivity-regression.rs b/src/test/ui/generic-associated-types/collectivity-regression.rs
new file mode 100644
index 000000000..fb7368439
--- /dev/null
+++ b/src/test/ui/generic-associated-types/collectivity-regression.rs
@@ -0,0 +1,24 @@
+// Regression test from https://github.com/rust-lang/rust/pull/98109
+
+#![feature(generic_associated_types)]
+
+pub trait Get {
+ type Value<'a>
+ where
+ Self: 'a;
+}
+
+fn multiply_at<T>(x: T)
+where
+ for<'a> T: Get<Value<'a> = ()>,
+{
+ || {
+ //~^ `T` does not live long enough
+ //
+ // FIXME(#98437). This regressed at some point and
+ // probably should work.
+ let _x = x;
+ };
+}
+
+fn main() {}