]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/min_const_fn/min_const_fn.nll.stderr
Update output for borrowck=migrate compare mode.
[rust.git] / src / test / ui / consts / min_const_fn / min_const_fn.nll.stderr
1 error[E0493]: destructors cannot be evaluated at compile-time
2   --> $DIR/min_const_fn.rs:47:25
3    |
4 LL |     const fn into_inner(self) -> T { self.0 } //~ destructors cannot be evaluated
5    |                         ^^^^ constant functions cannot evaluate destructors
6
7 error: mutable references in const fn are unstable
8   --> $DIR/min_const_fn.rs:49:36
9    |
10 LL |     const fn get_mut(&mut self) -> &mut T { &mut self.0 }
11    |                                    ^^^^^^
12
13 error[E0493]: destructors cannot be evaluated at compile-time
14   --> $DIR/min_const_fn.rs:54:28
15    |
16 LL |     const fn into_inner_lt(self) -> T { self.0 } //~ destructors cannot be evaluated
17    |                            ^^^^ constant functions cannot evaluate destructors
18
19 error: mutable references in const fn are unstable
20   --> $DIR/min_const_fn.rs:56:42
21    |
22 LL |     const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
23    |                                          ^^^^^^
24
25 error[E0493]: destructors cannot be evaluated at compile-time
26   --> $DIR/min_const_fn.rs:61:27
27    |
28 LL |     const fn into_inner_s(self) -> T { self.0 } //~ ERROR destructors
29    |                           ^^^^ constant functions cannot evaluate destructors
30
31 error: mutable references in const fn are unstable
32   --> $DIR/min_const_fn.rs:63:38
33    |
34 LL |     const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
35    |                                      ^^^^^^
36
37 error: mutable references in const fn are unstable
38   --> $DIR/min_const_fn.rs:68:39
39    |
40 LL |     const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
41    |                                       ^^^^^^
42
43 error: trait bounds other than `Sized` on const fn parameters are unstable
44   --> $DIR/min_const_fn.rs:86:16
45    |
46 LL | const fn foo11<T: std::fmt::Display>(t: T) -> T { t }
47    |                ^
48
49 error: trait bounds other than `Sized` on const fn parameters are unstable
50   --> $DIR/min_const_fn.rs:88:18
51    |
52 LL | const fn foo11_2<T: Send>(t: T) -> T { t }
53    |                  ^
54
55 error: only int, `bool` and `char` operations are stable in const fn
56   --> $DIR/min_const_fn.rs:90:33
57    |
58 LL | const fn foo19(f: f32) -> f32 { f * 2.0 }
59    |                                 ^^^^^^^
60
61 error: only int, `bool` and `char` operations are stable in const fn
62   --> $DIR/min_const_fn.rs:92:35
63    |
64 LL | const fn foo19_2(f: f32) -> f32 { 2.0 - f }
65    |                                   ^^^^^^^
66
67 error: only int and `bool` operations are stable in const fn
68   --> $DIR/min_const_fn.rs:94:35
69    |
70 LL | const fn foo19_3(f: f32) -> f32 { -f }
71    |                                   ^^
72
73 error: only int, `bool` and `char` operations are stable in const fn
74   --> $DIR/min_const_fn.rs:96:43
75    |
76 LL | const fn foo19_4(f: f32, g: f32) -> f32 { f / g }
77    |                                           ^^^^^
78
79 error: cannot access `static` items in const fn
80   --> $DIR/min_const_fn.rs:100:27
81    |
82 LL | const fn foo25() -> u32 { BAR } //~ ERROR cannot access `static` items in const fn
83    |                           ^^^
84
85 error: cannot access `static` items in const fn
86   --> $DIR/min_const_fn.rs:101:36
87    |
88 LL | const fn foo26() -> &'static u32 { &BAR } //~ ERROR cannot access `static` items
89    |                                    ^^^^
90
91 error: casting pointers to ints is unstable in const fn
92   --> $DIR/min_const_fn.rs:102:42
93    |
94 LL | const fn foo30(x: *const u32) -> usize { x as usize }
95    |                                          ^^^^^^^^^^
96
97 error: casting pointers to ints is unstable in const fn
98   --> $DIR/min_const_fn.rs:104:42
99    |
100 LL | const fn foo30_2(x: *mut u32) -> usize { x as usize }
101    |                                          ^^^^^^^^^^
102
103 error: `if`, `match`, `&&` and `||` are not stable in const fn
104   --> $DIR/min_const_fn.rs:106:38
105    |
106 LL | const fn foo30_4(b: bool) -> usize { if b { 1 } else { 42 } }
107    |                                      ^^^^^^^^^^^^^^^^^^^^^^
108
109 error: `if`, `match`, `&&` and `||` are not stable in const fn
110   --> $DIR/min_const_fn.rs:108:29
111    |
112 LL | const fn foo30_5(b: bool) { while b { } } //~ ERROR not stable in const fn
113    |                             ^^^^^^^^^^^
114
115 error: local variables in const fn are unstable
116   --> $DIR/min_const_fn.rs:109:34
117    |
118 LL | const fn foo30_6() -> bool { let x = true; x } //~ ERROR local variables in const fn are unstable
119    |                                  ^
120
121 error: `if`, `match`, `&&` and `||` are not stable in const fn
122   --> $DIR/min_const_fn.rs:110:44
123    |
124 LL | const fn foo36(a: bool, b: bool) -> bool { a && b }
125    |                                            ^^^^^^
126
127 error: `if`, `match`, `&&` and `||` are not stable in const fn
128   --> $DIR/min_const_fn.rs:112:44
129    |
130 LL | const fn foo37(a: bool, b: bool) -> bool { a || b }
131    |                                            ^^^^^^
132
133 error: mutable references in const fn are unstable
134   --> $DIR/min_const_fn.rs:114:14
135    |
136 LL | const fn inc(x: &mut i32) { *x += 1 }
137    |              ^
138
139 error: trait bounds other than `Sized` on const fn parameters are unstable
140   --> $DIR/min_const_fn.rs:119:6
141    |
142 LL | impl<T: std::fmt::Debug> Foo<T> {
143    |      ^
144
145 error: trait bounds other than `Sized` on const fn parameters are unstable
146   --> $DIR/min_const_fn.rs:124:6
147    |
148 LL | impl<T: std::fmt::Debug + Sized> Foo<T> {
149    |      ^
150
151 error: trait bounds other than `Sized` on const fn parameters are unstable
152   --> $DIR/min_const_fn.rs:129:6
153    |
154 LL | impl<T: Sync + Sized> Foo<T> {
155    |      ^
156
157 error: `impl Trait` in const fn is unstable
158   --> $DIR/min_const_fn.rs:135:24
159    |
160 LL | const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> { AlanTuring(0) }
161    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
162
163 error: trait bounds other than `Sized` on const fn parameters are unstable
164   --> $DIR/min_const_fn.rs:137:34
165    |
166 LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
167    |                                  ^^^^^^^^^^^^^^^^^^^^
168
169 error: trait bounds other than `Sized` on const fn parameters are unstable
170   --> $DIR/min_const_fn.rs:139:22
171    |
172 LL | const fn no_apit(_x: impl std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized`
173    |                      ^^^^^^^^^^^^^^^^^^^^
174
175 error: `impl Trait` in const fn is unstable
176   --> $DIR/min_const_fn.rs:140:23
177    |
178 LL | const fn no_rpit() -> impl std::fmt::Debug {} //~ ERROR `impl Trait` in const fn is unstable
179    |                       ^^^^^^^^^^^^^^^^^^^^
180
181 error: trait bounds other than `Sized` on const fn parameters are unstable
182   --> $DIR/min_const_fn.rs:141:23
183    |
184 LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized`
185    |                       ^^
186
187 error: trait bounds other than `Sized` on const fn parameters are unstable
188   --> $DIR/min_const_fn.rs:142:32
189    |
190 LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
191    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
192
193 warning[E0716]: temporary value dropped while borrowed
194   --> $DIR/min_const_fn.rs:142:64
195    |
196 LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
197    |                                                                ^^ - temporary value is freed at the end of this statement
198    |                                                                |
199    |                                                                creates a temporary which is freed while still in use
200    |
201    = note: borrowed value must be valid for the static lifetime...
202    = warning: This error has been downgraded to a warning for backwards compatibility with previous releases.
203            It represents potential unsoundness in your code.
204            This warning will become a hard error in the future.
205
206 error: trait bounds other than `Sized` on const fn parameters are unstable
207   --> $DIR/min_const_fn.rs:147:41
208    |
209 LL | const fn really_no_traits_i_mean_it() { (&() as &std::fmt::Debug, ()).1 }
210    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
211
212 error: function pointers in const fn are unstable
213   --> $DIR/min_const_fn.rs:150:21
214    |
215 LL | const fn no_fn_ptrs(_x: fn()) {}
216    |                     ^^
217
218 error: function pointers in const fn are unstable
219   --> $DIR/min_const_fn.rs:152:27
220    |
221 LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
222    |                           ^^^^
223
224 error: aborting due to 35 previous errors
225
226 Some errors occurred: E0493, E0716.
227 For more information about an error, try `rustc --explain E0493`.