summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/min_const_fn/min_const_fn.stderr
blob: 11c79e8e2d6a99ad779c5f7a96eaec79c88fe571 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
error[E0493]: destructor of `Foo<T>` cannot be evaluated at compile-time
  --> $DIR/min_const_fn.rs:37:25
   |
LL |     const fn into_inner(self) -> T { self.0 }
   |                         ^^^^                - value is dropped here
   |                         |
   |                         the destructor for this type cannot be evaluated in constant functions

error[E0658]: mutable references are not allowed in constant functions
  --> $DIR/min_const_fn.rs:39:22
   |
LL |     const fn get_mut(&mut self) -> &mut T { &mut self.0 }
   |                      ^^^^^^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0658]: mutable references are not allowed in constant functions
  --> $DIR/min_const_fn.rs:39:36
   |
LL |     const fn get_mut(&mut self) -> &mut T { &mut self.0 }
   |                                    ^^^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0658]: mutable references are not allowed in constant functions
  --> $DIR/min_const_fn.rs:39:45
   |
LL |     const fn get_mut(&mut self) -> &mut T { &mut self.0 }
   |                                             ^^^^^^^^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0493]: destructor of `Foo<T>` cannot be evaluated at compile-time
  --> $DIR/min_const_fn.rs:46:28
   |
LL |     const fn into_inner_lt(self) -> T { self.0 }
   |                            ^^^^                - value is dropped here
   |                            |
   |                            the destructor for this type cannot be evaluated in constant functions

error[E0658]: mutable references are not allowed in constant functions
  --> $DIR/min_const_fn.rs:48:25
   |
LL |     const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
   |                         ^^^^^^^^^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0658]: mutable references are not allowed in constant functions
  --> $DIR/min_const_fn.rs:48:42
   |
LL |     const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
   |                                          ^^^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0658]: mutable references are not allowed in constant functions
  --> $DIR/min_const_fn.rs:48:51
   |
LL |     const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
   |                                                   ^^^^^^^^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0493]: destructor of `Foo<T>` cannot be evaluated at compile-time
  --> $DIR/min_const_fn.rs:55:27
   |
LL |     const fn into_inner_s(self) -> T { self.0 }
   |                           ^^^^                - value is dropped here
   |                           |
   |                           the destructor for this type cannot be evaluated in constant functions

error[E0658]: mutable references are not allowed in constant functions
  --> $DIR/min_const_fn.rs:57:24
   |
LL |     const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
   |                        ^^^^^^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0658]: mutable references are not allowed in constant functions
  --> $DIR/min_const_fn.rs:57:38
   |
LL |     const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
   |                                      ^^^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0658]: mutable references are not allowed in constant functions
  --> $DIR/min_const_fn.rs:57:47
   |
LL |     const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
   |                                               ^^^^^^^^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0658]: mutable references are not allowed in constant functions
  --> $DIR/min_const_fn.rs:64:25
   |
LL |     const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
   |                         ^^^^^^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0658]: mutable references are not allowed in constant functions
  --> $DIR/min_const_fn.rs:64:39
   |
LL |     const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
   |                                       ^^^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0658]: mutable references are not allowed in constant functions
  --> $DIR/min_const_fn.rs:64:48
   |
LL |     const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
   |                                                ^^^^^^^^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0013]: constant functions cannot refer to statics
  --> $DIR/min_const_fn.rs:89:27
   |
LL | const fn foo25() -> u32 { BAR }
   |                           ^^^
   |
   = help: consider extracting the value of the `static` to a `const`, and referring to that

error[E0013]: constant functions cannot refer to statics
  --> $DIR/min_const_fn.rs:90:37
   |
LL | const fn foo26() -> &'static u32 { &BAR }
   |                                     ^^^
   |
   = help: consider extracting the value of the `static` to a `const`, and referring to that

error: pointers cannot be cast to integers during const eval
  --> $DIR/min_const_fn.rs:91:42
   |
LL | const fn foo30(x: *const u32) -> usize { x as usize }
   |                                          ^^^^^^^^^^
   |
   = note: at compile-time, pointers do not have an integer value
   = note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior

error: pointers cannot be cast to integers during const eval
  --> $DIR/min_const_fn.rs:93:63
   |
LL | const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } }
   |                                                               ^^^^^^^^^^
   |
   = note: at compile-time, pointers do not have an integer value
   = note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior

error: pointers cannot be cast to integers during const eval
  --> $DIR/min_const_fn.rs:95:42
   |
LL | const fn foo30_2(x: *mut u32) -> usize { x as usize }
   |                                          ^^^^^^^^^^
   |
   = note: at compile-time, pointers do not have an integer value
   = note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior

error: pointers cannot be cast to integers during const eval
  --> $DIR/min_const_fn.rs:97:63
   |
LL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } }
   |                                                               ^^^^^^^^^^
   |
   = note: at compile-time, pointers do not have an integer value
   = note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior

error[E0658]: mutable references are not allowed in constant functions
  --> $DIR/min_const_fn.rs:100:14
   |
LL | const fn inc(x: &mut i32) { *x += 1 }
   |              ^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0493]: destructor of `AlanTuring<impl std::fmt::Debug>` cannot be evaluated at compile-time
  --> $DIR/min_const_fn.rs:122:19
   |
LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
   |                   ^^                                     - value is dropped here
   |                   |
   |                   the destructor for this type cannot be evaluated in constant functions

error[E0493]: destructor of `impl std::fmt::Debug` cannot be evaluated at compile-time
  --> $DIR/min_const_fn.rs:124:18
   |
LL | const fn no_apit(_x: impl std::fmt::Debug) {}
   |                  ^^                         - value is dropped here
   |                  |
   |                  the destructor for this type cannot be evaluated in constant functions

error: aborting due to 24 previous errors

Some errors have detailed explanations: E0013, E0493, E0658.
For more information about an error, try `rustc --explain E0013`.