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