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 --- ...n-return-type-requires-explicit-lifetime.stderr | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr (limited to 'src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr') diff --git a/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr b/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr new file mode 100644 index 000000000..d07754879 --- /dev/null +++ b/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr @@ -0,0 +1,75 @@ +error[E0106]: missing lifetime specifier + --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:2:11 + | +LL | fn f() -> &isize { + | ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from +help: consider using the `'static` lifetime + | +LL | fn f() -> &'static isize { + | +++++++ + +error[E0106]: missing lifetime specifier + --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:7:33 + | +LL | fn g(_x: &isize, _y: &isize) -> &isize { + | ------ ------ ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `_x` or `_y` +help: consider introducing a named lifetime parameter + | +LL | fn g<'a>(_x: &'a isize, _y: &'a isize) -> &'a isize { + | ++++ ++ ++ ++ + +error[E0106]: missing lifetime specifier + --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:17:19 + | +LL | fn h(_x: &Foo) -> &isize { + | ---- ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say which one of `_x`'s 2 lifetimes it is borrowed from +help: consider introducing a named lifetime parameter + | +LL | fn h<'a>(_x: &'a Foo<'a>) -> &'a isize { + | ++++ ++ ++++ ++ + +error[E0106]: missing lifetime specifier + --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:21:20 + | +LL | fn i(_x: isize) -> &isize { + | ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from +help: consider using the `'static` lifetime + | +LL | fn i(_x: isize) -> &'static isize { + | +++++++ + +error[E0106]: missing lifetime specifier + --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:34:24 + | +LL | fn j(_x: StaticStr) -> &isize { + | ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from +help: consider using the `'static` lifetime + | +LL | fn j(_x: StaticStr) -> &'static isize { + | +++++++ + +error[E0106]: missing lifetime specifier + --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:40:49 + | +LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &isize { + | ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from +help: consider using the `'a` lifetime + | +LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &'a isize { + | ++ + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0106`. -- cgit v1.2.3