From ef24de24a82fe681581cc130f342363c47c0969a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 7 Jun 2024 07:48:48 +0200 Subject: Merging upstream version 1.75.0+dfsg1. Signed-off-by: Daniel Baumann --- .../borrowck/alias-liveness/escaping-bounds-2.stderr | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/ui/borrowck/alias-liveness/escaping-bounds-2.stderr (limited to 'tests/ui/borrowck/alias-liveness/escaping-bounds-2.stderr') diff --git a/tests/ui/borrowck/alias-liveness/escaping-bounds-2.stderr b/tests/ui/borrowck/alias-liveness/escaping-bounds-2.stderr new file mode 100644 index 000000000..7fd0cb9bb --- /dev/null +++ b/tests/ui/borrowck/alias-liveness/escaping-bounds-2.stderr @@ -0,0 +1,19 @@ +error[E0716]: temporary value dropped while borrowed + --> $DIR/escaping-bounds-2.rs:10:31 + | +LL | let func = get_func::(&String::new()); + | ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement + | | + | creates a temporary value which is freed while still in use +LL | drop(func); + | ---- borrow later used here + | +help: consider using a `let` binding to create a longer lived value + | +LL ~ let binding = String::new(); +LL ~ let func = get_func::(&binding); + | + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0716`. -- cgit v1.2.3