mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Added the issue link and a test description for non-promotable-static-ref.rs
This commit is contained in:
@@ -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 { t }
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user