@@ -16,12 +16,6 @@ error: `~const` can only be applied to `#[const_trait]` traits
1616LL | T: ~const Fn<()> + ~const Destruct,
1717 | ^^^^^^
1818
19- error: `~const` can only be applied to `#[const_trait]` traits
20- --> $DIR/fn_trait_refs.rs:14:24
21- |
22- LL | T: ~const Fn<()> + ~const Destruct,
23- | ^^^^^^
24-
2519error: `~const` can only be applied to `#[const_trait]` traits
2620 --> $DIR/fn_trait_refs.rs:14:8
2721 |
@@ -38,26 +32,12 @@ LL | T: ~const Fn<()> + ~const Destruct,
3832 |
3933 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
4034
41- error: `~const` can only be applied to `#[const_trait]` traits
42- --> $DIR/fn_trait_refs.rs:14:24
43- |
44- LL | T: ~const Fn<()> + ~const Destruct,
45- | ^^^^^^
46- |
47- = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
48-
4935error: `~const` can only be applied to `#[const_trait]` traits
5036 --> $DIR/fn_trait_refs.rs:21:8
5137 |
5238LL | T: ~const FnMut<()> + ~const Destruct,
5339 | ^^^^^^
5440
55- error: `~const` can only be applied to `#[const_trait]` traits
56- --> $DIR/fn_trait_refs.rs:21:27
57- |
58- LL | T: ~const FnMut<()> + ~const Destruct,
59- | ^^^^^^
60-
6141error: `~const` can only be applied to `#[const_trait]` traits
6242 --> $DIR/fn_trait_refs.rs:21:8
6343 |
@@ -74,14 +54,6 @@ LL | T: ~const FnMut<()> + ~const Destruct,
7454 |
7555 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
7656
77- error: `~const` can only be applied to `#[const_trait]` traits
78- --> $DIR/fn_trait_refs.rs:21:27
79- |
80- LL | T: ~const FnMut<()> + ~const Destruct,
81- | ^^^^^^
82- |
83- = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
84-
8557error: `~const` can only be applied to `#[const_trait]` traits
8658 --> $DIR/fn_trait_refs.rs:28:8
8759 |
@@ -110,12 +82,6 @@ error: `~const` can only be applied to `#[const_trait]` traits
11082LL | T: ~const Fn<()> + ~const Destruct,
11183 | ^^^^^^
11284
113- error: `~const` can only be applied to `#[const_trait]` traits
114- --> $DIR/fn_trait_refs.rs:35:24
115- |
116- LL | T: ~const Fn<()> + ~const Destruct,
117- | ^^^^^^
118-
11985error: `~const` can only be applied to `#[const_trait]` traits
12086 --> $DIR/fn_trait_refs.rs:35:8
12187 |
@@ -132,26 +98,12 @@ LL | T: ~const Fn<()> + ~const Destruct,
13298 |
13399 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
134100
135- error: `~const` can only be applied to `#[const_trait]` traits
136- --> $DIR/fn_trait_refs.rs:35:24
137- |
138- LL | T: ~const Fn<()> + ~const Destruct,
139- | ^^^^^^
140- |
141- = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
142-
143101error: `~const` can only be applied to `#[const_trait]` traits
144102 --> $DIR/fn_trait_refs.rs:49:8
145103 |
146104LL | T: ~const FnMut<()> + ~const Destruct,
147105 | ^^^^^^
148106
149- error: `~const` can only be applied to `#[const_trait]` traits
150- --> $DIR/fn_trait_refs.rs:49:27
151- |
152- LL | T: ~const FnMut<()> + ~const Destruct,
153- | ^^^^^^
154-
155107error: `~const` can only be applied to `#[const_trait]` traits
156108 --> $DIR/fn_trait_refs.rs:49:8
157109 |
@@ -168,29 +120,35 @@ LL | T: ~const FnMut<()> + ~const Destruct,
168120 |
169121 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
170122
171- error: `~const` can only be applied to `#[const_trait]` traits
172- --> $DIR/fn_trait_refs.rs:49:27
173- |
174- LL | T: ~const FnMut<()> + ~const Destruct,
175- | ^^^^^^
123+ error[E0277]: the trait bound `fn() -> i32 {one}: const Destruct` is not satisfied
124+ --> $DIR/fn_trait_refs.rs:70:24
176125 |
177- = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
126+ LL | let test_one = test_fn(one);
127+ | ^^^^^^^^^^^^
178128
179- error[E0015 ]: cannot call non- const operator in constants
180- --> $DIR/fn_trait_refs.rs:71:17
129+ error[E0277 ]: the trait bound `fn() -> i32 {two}: const Destruct` is not satisfied
130+ --> $DIR/fn_trait_refs.rs:73:24
181131 |
182- LL | assert!(test_one == (1, 1, 1));
183- | ^^^^^^^^^^^^^^^^^^^^^
132+ LL | let test_two = test_fn_mut(two);
133+ | ^^^^^^^^^^^^^^^^
134+
135+ error[E0277]: the trait bound `&T: ~const Destruct` is not satisfied
136+ --> $DIR/fn_trait_refs.rs:39:9
184137 |
185- = note: calls in constants are limited to constant functions, tuple structs and tuple variants
138+ LL | tester_fn(&f),
139+ | ^^^^^^^^^^^^^
186140
187- error[E0015 ]: cannot call non- const operator in constants
188- --> $DIR/fn_trait_refs.rs:74:17
141+ error[E0277 ]: the trait bound `&T: ~ const Destruct` is not satisfied
142+ --> $DIR/fn_trait_refs.rs:41:9
189143 |
190- LL | assert!(test_two == (2, 2));
191- | ^^^^^^^^^^^^^^^^^^
144+ LL | tester_fn_mut(&f),
145+ | ^^^^^^^^^^^^^^^^^
146+
147+ error[E0277]: the trait bound `&mut T: ~const Destruct` is not satisfied
148+ --> $DIR/fn_trait_refs.rs:53:9
192149 |
193- = note: calls in constants are limited to constant functions, tuple structs and tuple variants
150+ LL | tester_fn_mut(&mut f),
151+ | ^^^^^^^^^^^^^^^^^^^^^
194152
195153error[E0015]: cannot call non-const closure in constant functions
196154 --> $DIR/fn_trait_refs.rs:16:5
@@ -204,15 +162,6 @@ help: consider further restricting this bound
204162LL | T: ~const Fn<()> + ~const Destruct + ~const Fn(),
205163 | +++++++++++++
206164
207- error[E0493]: destructor of `T` cannot be evaluated at compile-time
208- --> $DIR/fn_trait_refs.rs:12:23
209- |
210- LL | const fn tester_fn<T>(f: T) -> T::Output
211- | ^ the destructor for this type cannot be evaluated in constant functions
212- ...
213- LL | }
214- | - value is dropped here
215-
216165error[E0015]: cannot call non-const closure in constant functions
217166 --> $DIR/fn_trait_refs.rs:23:5
218167 |
@@ -225,15 +174,6 @@ help: consider further restricting this bound
225174LL | T: ~const FnMut<()> + ~const Destruct + ~const FnMut(),
226175 | ++++++++++++++++
227176
228- error[E0493]: destructor of `T` cannot be evaluated at compile-time
229- --> $DIR/fn_trait_refs.rs:19:27
230- |
231- LL | const fn tester_fn_mut<T>(mut f: T) -> T::Output
232- | ^^^^^ the destructor for this type cannot be evaluated in constant functions
233- ...
234- LL | }
235- | - value is dropped here
236-
237177error[E0015]: cannot call non-const closure in constant functions
238178 --> $DIR/fn_trait_refs.rs:30:5
239179 |
@@ -246,25 +186,7 @@ help: consider further restricting this bound
246186LL | T: ~const FnOnce<()> + ~const FnOnce(),
247187 | +++++++++++++++++
248188
249- error[E0493]: destructor of `T` cannot be evaluated at compile-time
250- --> $DIR/fn_trait_refs.rs:33:21
251- |
252- LL | const fn test_fn<T>(mut f: T) -> (T::Output, T::Output, T::Output)
253- | ^^^^^ the destructor for this type cannot be evaluated in constant functions
254- ...
255- LL | }
256- | - value is dropped here
257-
258- error[E0493]: destructor of `T` cannot be evaluated at compile-time
259- --> $DIR/fn_trait_refs.rs:47:25
260- |
261- LL | const fn test_fn_mut<T>(mut f: T) -> (T::Output, T::Output)
262- | ^^^^^ the destructor for this type cannot be evaluated in constant functions
263- ...
264- LL | }
265- | - value is dropped here
266-
267- error: aborting due to 34 previous errors
189+ error: aborting due to 25 previous errors
268190
269- Some errors have detailed explanations: E0015, E0493 , E0635.
191+ Some errors have detailed explanations: E0015, E0277 , E0635.
270192For more information about an error, try `rustc --explain E0015`.
0 commit comments