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-17718-constants-not-static.stderr | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/ui/consts/issue-17718-constants-not-static.stderr (limited to 'tests/ui/consts/issue-17718-constants-not-static.stderr') diff --git a/tests/ui/consts/issue-17718-constants-not-static.stderr b/tests/ui/consts/issue-17718-constants-not-static.stderr new file mode 100644 index 000000000..8f3acae71 --- /dev/null +++ b/tests/ui/consts/issue-17718-constants-not-static.stderr @@ -0,0 +1,12 @@ +error[E0515]: cannot return reference to temporary value + --> $DIR/issue-17718-constants-not-static.rs:5:30 + | +LL | fn foo() -> &'static usize { &id(FOO) } + | ^------- + | || + | |temporary value created here + | returns a reference to data owned by the current function + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0515`. -- cgit v1.2.3