@@ -18,6 +18,12 @@ LL | T: ~const Fn<()> + ~const Destruct,
18
18
|
19
19
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
20
20
21
+ error[E0220]: associated type `Output` not found for `T`
22
+ --> $DIR/fn_trait_refs.rs:13:35
23
+ |
24
+ LL | const fn tester_fn<T>(f: T) -> T::Output
25
+ | ^^^^^^ associated type `Output` not found
26
+
21
27
error: `~const` can only be applied to `#[const_trait]` traits
22
28
--> $DIR/fn_trait_refs.rs:22:15
23
29
|
@@ -32,6 +38,12 @@ LL | T: ~const FnMut<()> + ~const Destruct,
32
38
|
33
39
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
34
40
41
+ error[E0220]: associated type `Output` not found for `T`
42
+ --> $DIR/fn_trait_refs.rs:20:43
43
+ |
44
+ LL | const fn tester_fn_mut<T>(mut f: T) -> T::Output
45
+ | ^^^^^^ associated type `Output` not found
46
+
35
47
error: `~const` can only be applied to `#[const_trait]` traits
36
48
--> $DIR/fn_trait_refs.rs:29:15
37
49
|
@@ -46,6 +58,12 @@ LL | T: ~const FnOnce<()>,
46
58
|
47
59
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
48
60
61
+ error[E0220]: associated type `Output` not found for `T`
62
+ --> $DIR/fn_trait_refs.rs:27:40
63
+ |
64
+ LL | const fn tester_fn_once<T>(f: T) -> T::Output
65
+ | ^^^^^^ associated type `Output` not found
66
+
49
67
error: `~const` can only be applied to `#[const_trait]` traits
50
68
--> $DIR/fn_trait_refs.rs:36:15
51
69
|
@@ -60,6 +78,24 @@ LL | T: ~const Fn<()> + ~const Destruct,
60
78
|
61
79
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
62
80
81
+ error[E0220]: associated type `Output` not found for `T`
82
+ --> $DIR/fn_trait_refs.rs:34:38
83
+ |
84
+ LL | const fn test_fn<T>(mut f: T) -> (T::Output, T::Output, T::Output)
85
+ | ^^^^^^ associated type `Output` not found
86
+
87
+ error[E0220]: associated type `Output` not found for `T`
88
+ --> $DIR/fn_trait_refs.rs:34:49
89
+ |
90
+ LL | const fn test_fn<T>(mut f: T) -> (T::Output, T::Output, T::Output)
91
+ | ^^^^^^ associated type `Output` not found
92
+
93
+ error[E0220]: associated type `Output` not found for `T`
94
+ --> $DIR/fn_trait_refs.rs:34:60
95
+ |
96
+ LL | const fn test_fn<T>(mut f: T) -> (T::Output, T::Output, T::Output)
97
+ | ^^^^^^ associated type `Output` not found
98
+
63
99
error: `~const` can only be applied to `#[const_trait]` traits
64
100
--> $DIR/fn_trait_refs.rs:50:15
65
101
|
@@ -74,115 +110,52 @@ LL | T: ~const FnMut<()> + ~const Destruct,
74
110
|
75
111
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
76
112
77
- error[E0015]: cannot call non-const operator in constants
78
- --> $DIR/fn_trait_refs.rs:72:17
79
- |
80
- LL | assert!(test_one == (1, 1, 1));
81
- | ^^^^^^^^^^^^^^^^^^^^^
82
- |
83
- = note: calls in constants are limited to constant functions, tuple structs and tuple variants
84
- help: add `#![feature(effects)]` to the crate attributes to enable
85
- |
86
- LL + #![feature(effects)]
113
+ error[E0220]: associated type `Output` not found for `T`
114
+ --> $DIR/fn_trait_refs.rs:48:42
87
115
|
116
+ LL | const fn test_fn_mut<T>(mut f: T) -> (T::Output, T::Output)
117
+ | ^^^^^^ associated type `Output` not found
88
118
89
- error[E0015]: cannot call non-const operator in constants
90
- --> $DIR/fn_trait_refs.rs:75:17
91
- |
92
- LL | assert!(test_two == (2, 2));
93
- | ^^^^^^^^^^^^^^^^^^
94
- |
95
- = note: calls in constants are limited to constant functions, tuple structs and tuple variants
96
- help: add `#![feature(effects)]` to the crate attributes to enable
97
- |
98
- LL + #![feature(effects)]
119
+ error[E0220]: associated type `Output` not found for `T`
120
+ --> $DIR/fn_trait_refs.rs:48:53
99
121
|
122
+ LL | const fn test_fn_mut<T>(mut f: T) -> (T::Output, T::Output)
123
+ | ^^^^^^ associated type `Output` not found
100
124
101
- error[E0015 ]: cannot call non-const closure in constant functions
125
+ error[E0618 ]: expected function, found `T`
102
126
--> $DIR/fn_trait_refs.rs:17:5
103
127
|
104
- LL | f()
105
- | ^^^
106
- |
107
- = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
108
- help: consider further restricting this bound
109
- |
110
- LL | T: ~const Fn<()> + ~const Destruct + ~const std::ops::Fn<()>,
111
- | +++++++++++++++++++++++++
112
- help: add `#![feature(effects)]` to the crate attributes to enable
113
- |
114
- LL + #![feature(effects)]
115
- |
116
-
117
- error[E0493]: destructor of `T` cannot be evaluated at compile-time
118
- --> $DIR/fn_trait_refs.rs:13:23
119
- |
120
128
LL | const fn tester_fn<T>(f: T) -> T::Output
121
- | ^ the destructor for this type cannot be evaluated in constant functions
129
+ | - `f` has type `T`
122
130
...
123
- LL | }
124
- | - value is dropped here
125
-
126
- error[E0015]: cannot call non-const closure in constant functions
127
- --> $DIR/fn_trait_refs.rs:24:5
128
- |
129
131
LL | f()
130
- | ^^^
131
- |
132
- = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
133
- help: consider further restricting this bound
134
- |
135
- LL | T: ~const FnMut<()> + ~const Destruct + ~const std::ops::FnMut<()>,
136
- | ++++++++++++++++++++++++++++
137
- help: add `#![feature(effects)]` to the crate attributes to enable
138
- |
139
- LL + #![feature(effects)]
140
- |
132
+ | ^--
133
+ | |
134
+ | call expression requires function
141
135
142
- error[E0493 ]: destructor of `T` cannot be evaluated at compile-time
143
- --> $DIR/fn_trait_refs.rs:20:27
136
+ error[E0618 ]: expected function, found `T`
137
+ --> $DIR/fn_trait_refs.rs:24:5
144
138
|
145
139
LL | const fn tester_fn_mut<T>(mut f: T) -> T::Output
146
- | ^^^^^ the destructor for this type cannot be evaluated in constant functions
140
+ | ----- `f` has type `T`
147
141
...
148
- LL | }
149
- | - value is dropped here
150
-
151
- error[E0015]: cannot call non-const closure in constant functions
152
- --> $DIR/fn_trait_refs.rs:31:5
153
- |
154
142
LL | f()
155
- | ^^^
156
- |
157
- = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
158
- help: consider further restricting this bound
159
- |
160
- LL | T: ~const FnOnce<()> + ~const std::ops::FnOnce<()>,
161
- | +++++++++++++++++++++++++++++
162
- help: add `#![feature(effects)]` to the crate attributes to enable
163
- |
164
- LL + #![feature(effects)]
165
- |
143
+ | ^--
144
+ | |
145
+ | call expression requires function
166
146
167
- error[E0493]: destructor of `T` cannot be evaluated at compile-time
168
- --> $DIR/fn_trait_refs.rs:34:21
169
- |
170
- LL | const fn test_fn<T>(mut f: T) -> (T::Output, T::Output, T::Output)
171
- | ^^^^^ the destructor for this type cannot be evaluated in constant functions
172
- ...
173
- LL | }
174
- | - value is dropped here
175
-
176
- error[E0493]: destructor of `T` cannot be evaluated at compile-time
177
- --> $DIR/fn_trait_refs.rs:48:25
147
+ error[E0618]: expected function, found `T`
148
+ --> $DIR/fn_trait_refs.rs:31:5
178
149
|
179
- LL | const fn test_fn_mut <T>(mut f: T) -> ( T::Output, T::Output)
180
- | ^^^^^ the destructor for this type cannot be evaluated in constant functions
150
+ LL | const fn tester_fn_once <T>(f: T) -> T::Output
151
+ | - `f` has type `T`
181
152
...
182
- LL | }
183
- | - value is dropped here
153
+ LL | f()
154
+ | ^--
155
+ | |
156
+ | call expression requires function
184
157
185
- error: aborting due to 20 previous errors
158
+ error: aborting due to 22 previous errors
186
159
187
- Some errors have detailed explanations: E0015, E0493 , E0635.
188
- For more information about an error, try `rustc --explain E0015 `.
160
+ Some errors have detailed explanations: E0220, E0618 , E0635.
161
+ For more information about an error, try `rustc --explain E0220 `.
0 commit comments