summaryrefslogtreecommitdiffstats
path: root/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs')
-rw-r--r--src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs b/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs
new file mode 100644
index 000000000..7327d8256
--- /dev/null
+++ b/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs
@@ -0,0 +1,13 @@
+fn bar<F>(blk: F) where F: FnOnce() + 'static {
+}
+
+fn foo(x: &()) {
+ bar(|| {
+ //~^ ERROR borrowed data escapes
+ //~| ERROR closure may outlive
+ let _ = x;
+ })
+}
+
+fn main() {
+}