]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/promote-not.stderr
Auto merge of #83572 - pkubaj:patch-1, r=nagisa
[rust.git] / src / test / ui / consts / promote-not.stderr
1 error[E0716]: temporary value dropped while borrowed
2   --> $DIR/promote-not.rs:9:50
3    |
4 LL | static mut TEST1: Option<&mut [i32]> = Some(&mut [1, 2, 3]);
5    |                                        ----------^^^^^^^^^-
6    |                                        |         |        |
7    |                                        |         |        temporary value is freed at the end of this statement
8    |                                        |         creates a temporary which is freed while still in use
9    |                                        using this value as a static requires that borrow lasts for `'static`
10
11 error[E0716]: temporary value dropped while borrowed
12   --> $DIR/promote-not.rs:12:18
13    |
14 LL |     let x = &mut [1,2,3];
15    |                  ^^^^^^^ creates a temporary which is freed while still in use
16 LL |     x
17    |     - using this value as a static requires that borrow lasts for `'static`
18 LL | };
19    | - temporary value is freed at the end of this statement
20
21 error[E0716]: temporary value dropped while borrowed
22   --> $DIR/promote-not.rs:21:32
23    |
24 LL |         let _x: &'static () = &foo();
25    |                 -----------    ^^^^^ creates a temporary which is freed while still in use
26    |                 |
27    |                 type annotation requires that borrow lasts for `'static`
28 LL |     }
29    |     - temporary value is freed at the end of this statement
30
31 error[E0716]: temporary value dropped while borrowed
32   --> $DIR/promote-not.rs:29:29
33    |
34 LL |     let _x: &'static i32 = &unsafe { U { x: 0 }.x };
35    |             ------------    ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
36    |             |
37    |             type annotation requires that borrow lasts for `'static`
38 LL | }
39    | - temporary value is freed at the end of this statement
40
41 error[E0716]: temporary value dropped while borrowed
42   --> $DIR/promote-not.rs:34:29
43    |
44 LL |     let _x: &'static i32 = &unsafe { U { x: 0 }.x };
45    |             ------------    ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
46    |             |
47    |             type annotation requires that borrow lasts for `'static`
48 LL | };
49    | - temporary value is freed at the end of this statement
50
51 error[E0716]: temporary value dropped while borrowed
52   --> $DIR/promote-not.rs:40:29
53    |
54 LL |     let _val: &'static _ = &(Cell::new(1), 2).1;
55    |               ----------    ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
56    |               |
57    |               type annotation requires that borrow lasts for `'static`
58 LL | };
59    | - temporary value is freed at the end of this statement
60
61 error[E0716]: temporary value dropped while borrowed
62   --> $DIR/promote-not.rs:45:29
63    |
64 LL |     let _val: &'static _ = &(Cell::new(1), 2).0;
65    |               ----------    ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
66    |               |
67    |               type annotation requires that borrow lasts for `'static`
68 ...
69 LL | }
70    | - temporary value is freed at the end of this statement
71
72 error[E0716]: temporary value dropped while borrowed
73   --> $DIR/promote-not.rs:46:29
74    |
75 LL |     let _val: &'static _ = &(Cell::new(1), 2).1;
76    |               ----------    ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
77    |               |
78    |               type annotation requires that borrow lasts for `'static`
79 ...
80 LL | }
81    | - temporary value is freed at the end of this statement
82
83 error[E0716]: temporary value dropped while borrowed
84   --> $DIR/promote-not.rs:49:29
85    |
86 LL |     let _val: &'static _ = &(1/0);
87    |               ----------    ^^^^^ creates a temporary which is freed while still in use
88    |               |
89    |               type annotation requires that borrow lasts for `'static`
90 ...
91 LL | }
92    | - temporary value is freed at the end of this statement
93
94 error[E0716]: temporary value dropped while borrowed
95   --> $DIR/promote-not.rs:50:29
96    |
97 LL |     let _val: &'static _ = &(1/(1-1));
98    |               ----------    ^^^^^^^^^ creates a temporary which is freed while still in use
99    |               |
100    |               type annotation requires that borrow lasts for `'static`
101 ...
102 LL | }
103    | - temporary value is freed at the end of this statement
104
105 error[E0716]: temporary value dropped while borrowed
106   --> $DIR/promote-not.rs:51:29
107    |
108 LL |     let _val: &'static _ = &(1%0);
109    |               ----------    ^^^^^ creates a temporary which is freed while still in use
110    |               |
111    |               type annotation requires that borrow lasts for `'static`
112 ...
113 LL | }
114    | - temporary value is freed at the end of this statement
115
116 error[E0716]: temporary value dropped while borrowed
117   --> $DIR/promote-not.rs:52:29
118    |
119 LL |     let _val: &'static _ = &(1%(1-1));
120    |               ----------    ^^^^^^^^^ creates a temporary which is freed while still in use
121    |               |
122    |               type annotation requires that borrow lasts for `'static`
123 LL |     let _val: &'static _ = &([1,2,3][4]+1);
124 LL | }
125    | - temporary value is freed at the end of this statement
126
127 error[E0716]: temporary value dropped while borrowed
128   --> $DIR/promote-not.rs:53:29
129    |
130 LL |     let _val: &'static _ = &([1,2,3][4]+1);
131    |               ----------    ^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
132    |               |
133    |               type annotation requires that borrow lasts for `'static`
134 LL | }
135    | - temporary value is freed at the end of this statement
136
137 error: aborting due to 13 previous errors
138
139 For more information about this error, try `rustc --explain E0716`.