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 --- tests/ui/consts/issue-54224.stderr | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/ui/consts/issue-54224.stderr (limited to 'tests/ui/consts/issue-54224.stderr') diff --git a/tests/ui/consts/issue-54224.stderr b/tests/ui/consts/issue-54224.stderr new file mode 100644 index 000000000..55fe55759 --- /dev/null +++ b/tests/ui/consts/issue-54224.stderr @@ -0,0 +1,23 @@ +error[E0716]: temporary value dropped while borrowed + --> $DIR/issue-54224.rs:1:39 + | +LL | const FOO: Option<&[[u8; 3]]> = Some(&[*b"foo"]); + | ------^^^^^^^^^- + | | | | + | | | temporary value is freed at the end of this statement + | | creates a temporary value which is freed while still in use + | using this value as a constant requires that borrow lasts for `'static` + +error[E0716]: temporary value dropped while borrowed + --> $DIR/issue-54224.rs:9:57 + | +LL | pub const Z: Cow<'static, [ [u8; 3] ]> = Cow::Borrowed(&[*b"ABC"]); + | ---------------^^^^^^^^^- + | | | | + | | | temporary value is freed at the end of this statement + | | creates a temporary value which is freed while still in use + | using this value as a constant requires that borrow lasts for `'static` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0716`. -- cgit v1.2.3