From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../lifetime-errors/ex3-both-anon-regions.stderr | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.stderr (limited to 'tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.stderr') diff --git a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.stderr b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.stderr new file mode 100644 index 000000000..ec9fac0c2 --- /dev/null +++ b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.stderr @@ -0,0 +1,17 @@ +error: lifetime may not live long enough + --> $DIR/ex3-both-anon-regions.rs:2:5 + | +LL | fn foo(x: &mut Vec<&u8>, y: &u8) { + | - - let's call the lifetime of this reference `'1` + | | + | let's call the lifetime of this reference `'2` +LL | x.push(y); + | ^^^^^^^^^ argument requires that `'1` must outlive `'2` + | +help: consider introducing a named lifetime parameter + | +LL | fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { + | ++++ ++ ++ + +error: aborting due to previous error + -- cgit v1.2.3