summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.rs')
-rw-r--r--tests/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.rs b/tests/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.rs
new file mode 100644
index 000000000..1cf8d187c
--- /dev/null
+++ b/tests/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.rs
@@ -0,0 +1,9 @@
+#![feature(thread_local)]
+
+#[thread_local]
+static FOO: u8 = 3;
+
+fn assert_static(_t: &'static u8) {}
+fn main() {
+ assert_static(&FOO); //~ ERROR [E0712]
+}