1 error[E0597]: `x` does not live long enough
2 --> $DIR/patterns.rs:8:9
5 | ^^ borrowed value does not live long enough
7 | - `x` dropped here while still borrowed
9 = note: borrowed value must be valid for the static lifetime...
11 error[E0597]: `x` does not live long enough
12 --> $DIR/patterns.rs:22:13
14 LL | let y = &x; //~ ERROR
15 | ^^ borrowed value does not live long enough
18 | - `x` dropped here while still borrowed
20 = note: borrowed value must be valid for the static lifetime...
22 error[E0597]: `x` does not live long enough
23 --> $DIR/patterns.rs:46:27
25 LL | let y: &'static u32 = &x; //~ ERROR
26 | ^^ borrowed value does not live long enough
28 | - `x` dropped here while still borrowed
30 = note: borrowed value must be valid for the static lifetime...
32 error[E0597]: `x` does not live long enough
33 --> $DIR/patterns.rs:51:27
35 LL | let _: &'static u32 = &x; //~ ERROR
36 | ^^ borrowed value does not live long enough
39 | - `x` dropped here while still borrowed
41 = note: borrowed value must be valid for the static lifetime...
43 error[E0716]: temporary value dropped while borrowed
44 --> $DIR/patterns.rs:53:41
46 LL | let _: Vec<&'static String> = vec![&String::new()];
47 | ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
49 | creates a temporary which is freed while still in use
51 = note: borrowed value must be valid for the static lifetime...
53 error[E0716]: temporary value dropped while borrowed
54 --> $DIR/patterns.rs:56:52
56 LL | let (_, a): (Vec<&'static String>, _) = (vec![&String::new()], 44);
57 | ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
59 | creates a temporary which is freed while still in use
61 = note: borrowed value must be valid for the static lifetime...
63 error[E0716]: temporary value dropped while borrowed
64 --> $DIR/patterns.rs:59:53
66 LL | let (_a, b): (Vec<&'static String>, _) = (vec![&String::new()], 44);
67 | ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
69 | creates a temporary which is freed while still in use
71 = note: borrowed value must be valid for the static lifetime...
73 error[E0597]: `x` does not live long enough
74 --> $DIR/patterns.rs:65:40
76 LL | let (_, _): (&'static u32, u32) = (&x, 44); //~ ERROR
77 | ^^ borrowed value does not live long enough
79 | - `x` dropped here while still borrowed
81 = note: borrowed value must be valid for the static lifetime...
83 error[E0597]: `x` does not live long enough
84 --> $DIR/patterns.rs:70:40
86 LL | let (y, _): (&'static u32, u32) = (&x, 44); //~ ERROR
87 | ^^ borrowed value does not live long enough
89 | - `x` dropped here while still borrowed
91 = note: borrowed value must be valid for the static lifetime...
93 error[E0597]: `x` does not live long enough
94 --> $DIR/patterns.rs:75:69
96 LL | let Single { value: y }: Single<&'static u32> = Single { value: &x }; //~ ERROR
97 | ^^ borrowed value does not live long enough
99 | - `x` dropped here while still borrowed
101 = note: borrowed value must be valid for the static lifetime...
103 error[E0597]: `x` does not live long enough
104 --> $DIR/patterns.rs:80:69
106 LL | let Single { value: _ }: Single<&'static u32> = Single { value: &x }; //~ ERROR
107 | ^^ borrowed value does not live long enough
109 | - `x` dropped here while still borrowed
111 = note: borrowed value must be valid for the static lifetime...
113 error[E0597]: `x` does not live long enough
114 --> $DIR/patterns.rs:88:17
116 LL | value1: &x, //~ ERROR
117 | ^^ borrowed value does not live long enough
120 | - `x` dropped here while still borrowed
122 = note: borrowed value must be valid for the static lifetime...
124 error: unsatisfied lifetime constraints
125 --> $DIR/patterns.rs:101:5
127 LL | fn static_to_a_to_static_through_variable<'a>(x: &'a u32) -> &'static u32 {
128 | -- lifetime `'a` defined here
131 | ^ returning this value requires that `'a` must outlive `'static`
133 error: unsatisfied lifetime constraints
134 --> $DIR/patterns.rs:117:18
136 LL | fn a_to_static_then_static<'a>(x: &'a u32) -> &'static u32 {
137 | -- lifetime `'a` defined here
138 LL | let (y, _z): (&'static u32, u32) = (x, 44); //~ ERROR
139 | ^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
141 error: aborting due to 14 previous errors
143 Some errors occurred: E0597, E0716.
144 For more information about an error, try `rustc --explain E0597`.