summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs')
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs
new file mode 100644
index 000000000..97fa9ef91
--- /dev/null
+++ b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs
@@ -0,0 +1,7 @@
+fn foo(x:Box<dyn Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
+ y.push(z);
+ //~^ ERROR lifetime may not live long enough
+ //~| ERROR cannot borrow
+}
+
+fn main() { }