about summary refs log tree commit diff
path: root/tests/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.stderr')
-rw-r--r--tests/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.stderr15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.stderr b/tests/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.stderr
new file mode 100644
index 00000000000..99fab4631a2
--- /dev/null
+++ b/tests/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.stderr
@@ -0,0 +1,15 @@
+error: lifetime may not live long enough
+  --> $DIR/ex2c-push-inference-variable.rs:7:5
+   |
+LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
+   |            --  -- lifetime `'c` defined here
+   |            |
+   |            lifetime `'b` defined here
+LL |     let z = Ref { data: y.data };
+LL |     x.push(z);
+   |     ^^^^^^^^^ argument requires that `'c` must outlive `'b`
+   |
+   = help: consider adding the following bound: `'c: 'b`
+
+error: aborting due to previous error
+