From 1eeba934aef84cf5fe94df9b3c1ead8e19f18ff9 Mon Sep 17 00:00:00 2001 From: Aryan Dubey Date: Fri, 20 Mar 2026 16:55:28 -0400 Subject: [PATCH] Added the issue link and a test description for non-promotable-static-ref.rs --- tests/ui/borrowck/non-promotable-static-ref.rs | 2 ++ tests/ui/borrowck/non-promotable-static-ref.stderr | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/ui/borrowck/non-promotable-static-ref.rs b/tests/ui/borrowck/non-promotable-static-ref.rs index efdcc4493056..44733493ec06 100644 --- a/tests/ui/borrowck/non-promotable-static-ref.rs +++ b/tests/ui/borrowck/non-promotable-static-ref.rs @@ -1,3 +1,5 @@ +//Test for https://github.com/rust-lang/rust/issues/52049 +//Tests that a non-promotable temp variable cannot be used as a static reference. fn foo(_: &'static u32) {} fn unpromotable(t: T) -> T { t } diff --git a/tests/ui/borrowck/non-promotable-static-ref.stderr b/tests/ui/borrowck/non-promotable-static-ref.stderr index 586e8fb314ea..979b349b7c00 100644 --- a/tests/ui/borrowck/non-promotable-static-ref.stderr +++ b/tests/ui/borrowck/non-promotable-static-ref.stderr @@ -1,5 +1,5 @@ error[E0716]: temporary value dropped while borrowed - --> $DIR/non-promotable-static-ref.rs:6:10 + --> $DIR/non-promotable-static-ref.rs:8:10 | LL | foo(&unpromotable(5u32)); | -----^^^^^^^^^^^^^^^^^^-- temporary value is freed at the end of this statement