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