diff options
Diffstat (limited to 'tests/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.rs')
-rw-r--r-- | tests/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.rs b/tests/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.rs new file mode 100644 index 000000000..998a48ce2 --- /dev/null +++ b/tests/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.rs @@ -0,0 +1,9 @@ +struct Ref<'a, T: 'a> { + data: &'a T +} + +fn foo<'a>(x: Ref<i32>, y: &mut Vec<Ref<'a, i32>>) { + y.push(x); //~ ERROR explicit lifetime +} + +fn main() { } |