]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/user-annotations/patterns.stderr
Fix a few tests with target-specific output
[rust.git] / src / test / ui / nll / user-annotations / patterns.stderr
1 error[E0597]: `x` does not live long enough
2   --> $DIR/patterns.rs:8:9
3    |
4 LL |     y = &x; //~ ERROR
5    |         ^^ borrowed value does not live long enough
6 LL | }
7    | - `x` dropped here while still borrowed
8    |
9    = note: borrowed value must be valid for the static lifetime...
10
11 error[E0597]: `x` does not live long enough
12   --> $DIR/patterns.rs:22:13
13    |
14 LL |     let y = &x; //~ ERROR
15    |             ^^ borrowed value does not live long enough
16 ...
17 LL | }
18    | - `x` dropped here while still borrowed
19    |
20    = note: borrowed value must be valid for the static lifetime...
21
22 error[E0597]: `x` does not live long enough
23   --> $DIR/patterns.rs:46:27
24    |
25 LL |     let y: &'static u32 = &x; //~ ERROR
26    |                           ^^ borrowed value does not live long enough
27 LL | }
28    | - `x` dropped here while still borrowed
29    |
30    = note: borrowed value must be valid for the static lifetime...
31
32 error[E0597]: `x` does not live long enough
33   --> $DIR/patterns.rs:51:27
34    |
35 LL |     let _: &'static u32 = &x; //~ ERROR
36    |                           ^^ borrowed value does not live long enough
37 ...
38 LL | }
39    | - `x` dropped here while still borrowed
40    |
41    = note: borrowed value must be valid for the static lifetime...
42
43 error[E0716]: temporary value dropped while borrowed
44   --> $DIR/patterns.rs:53:41
45    |
46 LL |     let _: Vec<&'static String> = vec![&String::new()];
47    |                                         ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
48    |                                         |
49    |                                         creates a temporary which is freed while still in use
50    |
51    = note: borrowed value must be valid for the static lifetime...
52
53 error[E0716]: temporary value dropped while borrowed
54   --> $DIR/patterns.rs:56:52
55    |
56 LL |     let (_, a): (Vec<&'static String>, _) = (vec![&String::new()], 44);
57    |                                                    ^^^^^^^^^^^^^      - temporary value is freed at the end of this statement
58    |                                                    |
59    |                                                    creates a temporary which is freed while still in use
60    |
61    = note: borrowed value must be valid for the static lifetime...
62
63 error[E0716]: temporary value dropped while borrowed
64   --> $DIR/patterns.rs:59:53
65    |
66 LL |     let (_a, b): (Vec<&'static String>, _) = (vec![&String::new()], 44);
67    |                                                     ^^^^^^^^^^^^^      - temporary value is freed at the end of this statement
68    |                                                     |
69    |                                                     creates a temporary which is freed while still in use
70    |
71    = note: borrowed value must be valid for the static lifetime...
72
73 error[E0597]: `x` does not live long enough
74   --> $DIR/patterns.rs:65:40
75    |
76 LL |     let (_, _): (&'static u32, u32) = (&x, 44); //~ ERROR
77    |                                        ^^ borrowed value does not live long enough
78 LL | }
79    | - `x` dropped here while still borrowed
80    |
81    = note: borrowed value must be valid for the static lifetime...
82
83 error[E0597]: `x` does not live long enough
84   --> $DIR/patterns.rs:70:40
85    |
86 LL |     let (y, _): (&'static u32, u32) = (&x, 44); //~ ERROR
87    |                                        ^^ borrowed value does not live long enough
88 LL | }
89    | - `x` dropped here while still borrowed
90    |
91    = note: borrowed value must be valid for the static lifetime...
92
93 error[E0597]: `x` does not live long enough
94   --> $DIR/patterns.rs:75:69
95    |
96 LL |     let Single { value: y }: Single<&'static u32> = Single { value: &x }; //~ ERROR
97    |                                                                     ^^ borrowed value does not live long enough
98 LL | }
99    | - `x` dropped here while still borrowed
100    |
101    = note: borrowed value must be valid for the static lifetime...
102
103 error[E0597]: `x` does not live long enough
104   --> $DIR/patterns.rs:80:69
105    |
106 LL |     let Single { value: _ }: Single<&'static u32> = Single { value: &x }; //~ ERROR
107    |                                                                     ^^ borrowed value does not live long enough
108 LL | }
109    | - `x` dropped here while still borrowed
110    |
111    = note: borrowed value must be valid for the static lifetime...
112
113 error[E0597]: `x` does not live long enough
114   --> $DIR/patterns.rs:88:17
115    |
116 LL |         value1: &x, //~ ERROR
117    |                 ^^ borrowed value does not live long enough
118 ...
119 LL | }
120    | - `x` dropped here while still borrowed
121    |
122    = note: borrowed value must be valid for the static lifetime...
123
124 error: unsatisfied lifetime constraints
125   --> $DIR/patterns.rs:101:5
126    |
127 LL | fn static_to_a_to_static_through_variable<'a>(x: &'a u32) -> &'static u32 {
128    |                                           -- lifetime `'a` defined here
129 ...
130 LL |     y //~ ERROR
131    |     ^ returning this value requires that `'a` must outlive `'static`
132
133 error: unsatisfied lifetime constraints
134   --> $DIR/patterns.rs:117:18
135    |
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`
140
141 error: aborting due to 14 previous errors
142
143 Some errors occurred: E0597, E0716.
144 For more information about an error, try `rustc --explain E0597`.