From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/static/static-lifetime-bound.stderr | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/ui/static/static-lifetime-bound.stderr (limited to 'tests/ui/static/static-lifetime-bound.stderr') diff --git a/tests/ui/static/static-lifetime-bound.stderr b/tests/ui/static/static-lifetime-bound.stderr new file mode 100644 index 000000000..ef07a8931 --- /dev/null +++ b/tests/ui/static/static-lifetime-bound.stderr @@ -0,0 +1,22 @@ +warning: unnecessary lifetime parameter `'a` + --> $DIR/static-lifetime-bound.rs:1:6 + | +LL | fn f<'a: 'static>(_: &'a i32) {} + | ^^ + | + = help: you can use the `'static` lifetime directly, in place of `'a` + +error[E0597]: `x` does not live long enough + --> $DIR/static-lifetime-bound.rs:5:7 + | +LL | f(&x); + | --^^- + | | | + | | borrowed value does not live long enough + | argument requires that `x` is borrowed for `'static` +LL | } + | - `x` dropped here while still borrowed + +error: aborting due to previous error; 1 warning emitted + +For more information about this error, try `rustc --explain E0597`. -- cgit v1.2.3