@@ -72,7 +72,8 @@ use crate::marker::Tuple;
72
72
) ]
73
73
#[ fundamental] // so that regex can rely that `&str: !FnMut`
74
74
#[ must_use = "closures are lazy and do nothing unless called" ]
75
- // FIXME(const_trait_impl) #[const_trait]
75
+ #[ const_trait]
76
+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
76
77
pub trait Fn < Args : Tuple > : FnMut < Args > {
77
78
/// Performs the call operation.
78
79
#[ unstable( feature = "fn_traits" , issue = "29625" ) ]
@@ -159,7 +160,8 @@ pub trait Fn<Args: Tuple>: FnMut<Args> {
159
160
) ]
160
161
#[ fundamental] // so that regex can rely that `&str: !FnMut`
161
162
#[ must_use = "closures are lazy and do nothing unless called" ]
162
- // FIXME(const_trait_impl) #[const_trait]
163
+ #[ const_trait]
164
+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
163
165
pub trait FnMut < Args : Tuple > : FnOnce < Args > {
164
166
/// Performs the call operation.
165
167
#[ unstable( feature = "fn_traits" , issue = "29625" ) ]
@@ -238,7 +240,8 @@ pub trait FnMut<Args: Tuple>: FnOnce<Args> {
238
240
) ]
239
241
#[ fundamental] // so that regex can rely that `&str: !FnMut`
240
242
#[ must_use = "closures are lazy and do nothing unless called" ]
241
- // FIXME(const_trait_impl) #[const_trait]
243
+ #[ const_trait]
244
+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
242
245
pub trait FnOnce < Args : Tuple > {
243
246
/// The returned type after the call operator is used.
244
247
#[ lang = "fn_once_output" ]
@@ -254,29 +257,32 @@ mod impls {
254
257
use crate :: marker:: Tuple ;
255
258
256
259
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
257
- impl < A : Tuple , F : ?Sized > Fn < A > for & F
260
+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
261
+ impl < A : Tuple , F : ?Sized > const Fn < A > for & F
258
262
where
259
- F : Fn < A > ,
263
+ F : ~ const Fn < A > ,
260
264
{
261
265
extern "rust-call" fn call ( & self , args : A ) -> F :: Output {
262
266
( * * self ) . call ( args)
263
267
}
264
268
}
265
269
266
270
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
267
- impl < A : Tuple , F : ?Sized > FnMut < A > for & F
271
+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
272
+ impl < A : Tuple , F : ?Sized > const FnMut < A > for & F
268
273
where
269
- F : Fn < A > ,
274
+ F : ~ const Fn < A > ,
270
275
{
271
276
extern "rust-call" fn call_mut ( & mut self , args : A ) -> F :: Output {
272
277
( * * self ) . call ( args)
273
278
}
274
279
}
275
280
276
281
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
277
- impl < A : Tuple , F : ?Sized > FnOnce < A > for & F
282
+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
283
+ impl < A : Tuple , F : ?Sized > const FnOnce < A > for & F
278
284
where
279
- F : Fn < A > ,
285
+ F : ~ const Fn < A > ,
280
286
{
281
287
type Output = F :: Output ;
282
288
@@ -286,19 +292,21 @@ mod impls {
286
292
}
287
293
288
294
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
289
- impl < A : Tuple , F : ?Sized > FnMut < A > for & mut F
295
+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
296
+ impl < A : Tuple , F : ?Sized > const FnMut < A > for & mut F
290
297
where
291
- F : FnMut < A > ,
298
+ F : ~ const FnMut < A > ,
292
299
{
293
300
extern "rust-call" fn call_mut ( & mut self , args : A ) -> F :: Output {
294
301
( * self ) . call_mut ( args)
295
302
}
296
303
}
297
304
298
305
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
299
- impl < A : Tuple , F : ?Sized > FnOnce < A > for & mut F
306
+ #[ rustc_const_unstable( feature = "const_trait_impl" , issue = "67792" ) ]
307
+ impl < A : Tuple , F : ?Sized > const FnOnce < A > for & mut F
300
308
where
301
- F : FnMut < A > ,
309
+ F : ~ const FnMut < A > ,
302
310
{
303
311
type Output = F :: Output ;
304
312
extern "rust-call" fn call_once ( self , args : A ) -> F :: Output {
0 commit comments