From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/regions/regions-static-bound.stderr | 54 +++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/test/ui/regions/regions-static-bound.stderr (limited to 'src/test/ui/regions/regions-static-bound.stderr') diff --git a/src/test/ui/regions/regions-static-bound.stderr b/src/test/ui/regions/regions-static-bound.stderr new file mode 100644 index 000000000..2886ec3ea --- /dev/null +++ b/src/test/ui/regions/regions-static-bound.stderr @@ -0,0 +1,54 @@ +warning: unnecessary lifetime parameter `'a` + --> $DIR/regions-static-bound.rs:2:11 + | +LL | where 'a: 'static { t } + | ^^ + | + = help: you can use the `'static` lifetime directly, in place of `'a` + +warning: unnecessary lifetime parameter `'b` + --> $DIR/regions-static-bound.rs:6:19 + | +LL | where 'a: 'b, 'b: 'static { t } + | ^^ + | + = help: you can use the `'static` lifetime directly, in place of `'b` + +error: lifetime may not live long enough + --> $DIR/regions-static-bound.rs:10:5 + | +LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a { + | -- lifetime `'a` defined here +LL | t + | ^ returning this value requires that `'a` must outlive `'static` + +error[E0521]: borrowed data escapes outside of function + --> $DIR/regions-static-bound.rs:15:5 + | +LL | fn error(u: &(), v: &()) { + | - - let's call the lifetime of this reference `'1` + | | + | `u` is a reference that is only valid in the function body +LL | static_id(&u); + | ^^^^^^^^^^^^^ + | | + | `u` escapes the function body here + | argument requires that `'1` must outlive `'static` + +error[E0521]: borrowed data escapes outside of function + --> $DIR/regions-static-bound.rs:17:5 + | +LL | fn error(u: &(), v: &()) { + | - - let's call the lifetime of this reference `'2` + | | + | `v` is a reference that is only valid in the function body +... +LL | static_id_indirect(&v); + | ^^^^^^^^^^^^^^^^^^^^^^ + | | + | `v` escapes the function body here + | argument requires that `'2` must outlive `'static` + +error: aborting due to 3 previous errors; 2 warnings emitted + +For more information about this error, try `rustc --explain E0521`. -- cgit v1.2.3