1 error[E0493]: destructors cannot be evaluated at compile-time
2 --> $DIR/min_const_fn.rs:47:25
4 LL | const fn into_inner(self) -> T { self.0 } //~ destructors cannot be evaluated
5 | ^^^^ constant functions cannot evaluate destructors
7 error: mutable references in const fn are unstable
8 --> $DIR/min_const_fn.rs:49:36
10 LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 }
13 error[E0493]: destructors cannot be evaluated at compile-time
14 --> $DIR/min_const_fn.rs:54:28
16 LL | const fn into_inner_lt(self) -> T { self.0 } //~ destructors cannot be evaluated
17 | ^^^^ constant functions cannot evaluate destructors
19 error: mutable references in const fn are unstable
20 --> $DIR/min_const_fn.rs:56:42
22 LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
25 error[E0493]: destructors cannot be evaluated at compile-time
26 --> $DIR/min_const_fn.rs:61:27
28 LL | const fn into_inner_s(self) -> T { self.0 } //~ ERROR destructors
29 | ^^^^ constant functions cannot evaluate destructors
31 error: mutable references in const fn are unstable
32 --> $DIR/min_const_fn.rs:63:38
34 LL | const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
37 error: mutable references in const fn are unstable
38 --> $DIR/min_const_fn.rs:68:39
40 LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
43 error: trait bounds other than `Sized` on const fn parameters are unstable
44 --> $DIR/min_const_fn.rs:86:16
46 LL | const fn foo11<T: std::fmt::Display>(t: T) -> T { t }
49 error: trait bounds other than `Sized` on const fn parameters are unstable
50 --> $DIR/min_const_fn.rs:88:18
52 LL | const fn foo11_2<T: Send>(t: T) -> T { t }
55 error: only int, `bool` and `char` operations are stable in const fn
56 --> $DIR/min_const_fn.rs:90:33
58 LL | const fn foo19(f: f32) -> f32 { f * 2.0 }
61 error: only int, `bool` and `char` operations are stable in const fn
62 --> $DIR/min_const_fn.rs:92:35
64 LL | const fn foo19_2(f: f32) -> f32 { 2.0 - f }
67 error: only int and `bool` operations are stable in const fn
68 --> $DIR/min_const_fn.rs:94:35
70 LL | const fn foo19_3(f: f32) -> f32 { -f }
73 error: only int, `bool` and `char` operations are stable in const fn
74 --> $DIR/min_const_fn.rs:96:43
76 LL | const fn foo19_4(f: f32, g: f32) -> f32 { f / g }
79 error: cannot access `static` items in const fn
80 --> $DIR/min_const_fn.rs:100:27
82 LL | const fn foo25() -> u32 { BAR } //~ ERROR cannot access `static` items in const fn
85 error: cannot access `static` items in const fn
86 --> $DIR/min_const_fn.rs:101:36
88 LL | const fn foo26() -> &'static u32 { &BAR } //~ ERROR cannot access `static` items
91 error: casting pointers to ints is unstable in const fn
92 --> $DIR/min_const_fn.rs:102:42
94 LL | const fn foo30(x: *const u32) -> usize { x as usize }
97 error: casting pointers to ints is unstable in const fn
98 --> $DIR/min_const_fn.rs:104:42
100 LL | const fn foo30_2(x: *mut u32) -> usize { x as usize }
103 error: `if`, `match`, `&&` and `||` are not stable in const fn
104 --> $DIR/min_const_fn.rs:106:38
106 LL | const fn foo30_4(b: bool) -> usize { if b { 1 } else { 42 } }
107 | ^^^^^^^^^^^^^^^^^^^^^^
109 error: `if`, `match`, `&&` and `||` are not stable in const fn
110 --> $DIR/min_const_fn.rs:108:29
112 LL | const fn foo30_5(b: bool) { while b { } } //~ ERROR not stable in const fn
115 error: local variables in const fn are unstable
116 --> $DIR/min_const_fn.rs:109:34
118 LL | const fn foo30_6() -> bool { let x = true; x } //~ ERROR local variables in const fn are unstable
121 error: `if`, `match`, `&&` and `||` are not stable in const fn
122 --> $DIR/min_const_fn.rs:110:44
124 LL | const fn foo36(a: bool, b: bool) -> bool { a && b }
127 error: `if`, `match`, `&&` and `||` are not stable in const fn
128 --> $DIR/min_const_fn.rs:112:44
130 LL | const fn foo37(a: bool, b: bool) -> bool { a || b }
133 error: mutable references in const fn are unstable
134 --> $DIR/min_const_fn.rs:114:14
136 LL | const fn inc(x: &mut i32) { *x += 1 }
139 error: trait bounds other than `Sized` on const fn parameters are unstable
140 --> $DIR/min_const_fn.rs:119:6
142 LL | impl<T: std::fmt::Debug> Foo<T> {
145 error: trait bounds other than `Sized` on const fn parameters are unstable
146 --> $DIR/min_const_fn.rs:124:6
148 LL | impl<T: std::fmt::Debug + Sized> Foo<T> {
151 error: trait bounds other than `Sized` on const fn parameters are unstable
152 --> $DIR/min_const_fn.rs:129:6
154 LL | impl<T: Sync + Sized> Foo<T> {
157 error: `impl Trait` in const fn is unstable
158 --> $DIR/min_const_fn.rs:135:24
160 LL | const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> { AlanTuring(0) }
161 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
163 error: trait bounds other than `Sized` on const fn parameters are unstable
164 --> $DIR/min_const_fn.rs:137:34
166 LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
167 | ^^^^^^^^^^^^^^^^^^^^
169 error: trait bounds other than `Sized` on const fn parameters are unstable
170 --> $DIR/min_const_fn.rs:139:22
172 LL | const fn no_apit(_x: impl std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized`
173 | ^^^^^^^^^^^^^^^^^^^^
175 error: `impl Trait` in const fn is unstable
176 --> $DIR/min_const_fn.rs:140:23
178 LL | const fn no_rpit() -> impl std::fmt::Debug {} //~ ERROR `impl Trait` in const fn is unstable
179 | ^^^^^^^^^^^^^^^^^^^^
181 error: trait bounds other than `Sized` on const fn parameters are unstable
182 --> $DIR/min_const_fn.rs:141:23
184 LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized`
187 error: trait bounds other than `Sized` on const fn parameters are unstable
188 --> $DIR/min_const_fn.rs:142:32
190 LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
191 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
193 warning[E0716]: temporary value dropped while borrowed
194 --> $DIR/min_const_fn.rs:142:64
196 LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
197 | ^^ - temporary value is freed at the end of this statement
199 | creates a temporary which is freed while still in use
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.
206 error: trait bounds other than `Sized` on const fn parameters are unstable
207 --> $DIR/min_const_fn.rs:147:41
209 LL | const fn really_no_traits_i_mean_it() { (&() as &std::fmt::Debug, ()).1 }
210 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
212 error: function pointers in const fn are unstable
213 --> $DIR/min_const_fn.rs:150:21
215 LL | const fn no_fn_ptrs(_x: fn()) {}
218 error: function pointers in const fn are unstable
219 --> $DIR/min_const_fn.rs:152:27
221 LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
224 error: aborting due to 35 previous errors
226 Some errors occurred: E0493, E0716.
227 For more information about an error, try `rustc --explain E0493`.