Skip to content

Commit 6d2a545

Browse files
Rollup merge of #154156 - aryannrd:move-issue-52049-to-borrowck, r=Kivooeo
Moving issue-52049 to borrowck
2 parents 84cb74a + 1eeba93 commit 6d2a545

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

tests/ui/issues/issue-52049.rs renamed to tests/ui/borrowck/non-promotable-static-ref.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//Test for https://github.com/rust-lang/rust/issues/52049
2+
//Tests that a non-promotable temp variable cannot be used as a static reference.
13
fn foo(_: &'static u32) {}
24

35
fn unpromotable<T>(t: T) -> T { t }

tests/ui/issues/issue-52049.stderr renamed to tests/ui/borrowck/non-promotable-static-ref.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0716]: temporary value dropped while borrowed
2-
--> $DIR/issue-52049.rs:6:10
2+
--> $DIR/non-promotable-static-ref.rs:8:10
33
|
44
LL | foo(&unpromotable(5u32));
55
| -----^^^^^^^^^^^^^^^^^^-- temporary value is freed at the end of this statement

0 commit comments

Comments
 (0)