diff options
Diffstat (limited to 'tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs')
| -rw-r--r-- | tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs new file mode 100644 index 00000000000..97fa9ef914f --- /dev/null +++ b/tests/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() { } |
