Skip to content

Commit c8d81b1

Browse files
committed
Updated test with expected error message.
1 parent ee4c7ac commit c8d81b1

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/test/ui/issue-47184.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
#![feature(nll)]
1212

1313
fn main() {
14-
let vec: Vec<&'static String> = vec![&String::new()];
15-
//~^ ERROR
14+
let _vec: Vec<&'static String> = vec![&String::new()];
15+
//~^ ERROR borrowed value does not live long enough [E0597]
1616
}

src/test/ui/issue-47184.stderr

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0597]: borrowed value does not live long enough
2+
--> $DIR/issue-47184.rs:14:44
3+
|
4+
LL | let _vec: Vec<&'static String> = vec![&String::new()];
5+
| ^^^^^^^^^^^^^ temporary value does not live long enough
6+
LL | //~^ ERROR borrowed value does not live long enough [E0597]
7+
LL | }
8+
| - temporary value only lives until here
9+
|
10+
= note: borrowed value must be valid for the static lifetime...
11+
12+
error: aborting due to previous error
13+
14+
For more information about this error, try `rustc --explain E0597`.

0 commit comments

Comments
 (0)