summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfc-2093-infer-outlives/dont-infer-static.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rfc-2093-infer-outlives/dont-infer-static.rs')
-rw-r--r--tests/ui/rfc-2093-infer-outlives/dont-infer-static.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/rfc-2093-infer-outlives/dont-infer-static.rs b/tests/ui/rfc-2093-infer-outlives/dont-infer-static.rs
new file mode 100644
index 000000000..d3940b13b
--- /dev/null
+++ b/tests/ui/rfc-2093-infer-outlives/dont-infer-static.rs
@@ -0,0 +1,12 @@
+/*
+ * We don't infer `T: 'static` outlives relationships.
+ */
+
+struct Foo<U> {
+ bar: Bar<U> //~ ERROR the parameter type `U` may not live long enough [E0310]
+}
+struct Bar<T: 'static> {
+ x: T,
+}
+
+fn main() {}