@@ -56,7 +56,7 @@ use crate::marker::Tuple;
56
56
#[ lang = "fn" ]
57
57
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
58
58
#[ rustc_paren_sugar]
59
- #[ rustc_on_unimplemented(
59
+ #[ cfg_attr ( not ( bootstrap ) , rustc_on_unimplemented(
60
60
on(
61
61
Args = "()" ,
62
62
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}`"
@@ -67,9 +67,9 @@ use crate::marker::Tuple;
67
67
// SAFETY: tidy is not smart enough to tell that the below unsafe block is a string
68
68
label = "call the function in a closure: `|| unsafe {{ /* code */ }}`"
69
69
) ,
70
- message = "expected a `{Fn}<{Args}> ` closure, found `{Self}`" ,
71
- label = "expected an `Fn<{Args}> ` closure, found `{Self}`"
72
- ) ]
70
+ message = "expected a `{Trait} ` closure, found `{Self}`" ,
71
+ label = "expected an `{Trait} ` closure, found `{Self}`"
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
75
// FIXME(effects) #[const_trait]
@@ -143,7 +143,7 @@ pub trait Fn<Args: Tuple>: FnMut<Args> {
143
143
#[ lang = "fn_mut" ]
144
144
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
145
145
#[ rustc_paren_sugar]
146
- #[ rustc_on_unimplemented(
146
+ #[ cfg_attr ( not ( bootstrap ) , rustc_on_unimplemented(
147
147
on(
148
148
Args = "()" ,
149
149
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}`"
@@ -154,9 +154,9 @@ pub trait Fn<Args: Tuple>: FnMut<Args> {
154
154
// SAFETY: tidy is not smart enough to tell that the below unsafe block is a string
155
155
label = "call the function in a closure: `|| unsafe {{ /* code */ }}`"
156
156
) ,
157
- message = "expected a `{FnMut}<{Args}> ` closure, found `{Self}`" ,
158
- label = "expected an `FnMut<{Args}> ` closure, found `{Self}`"
159
- ) ]
157
+ message = "expected a `{Trait} ` closure, found `{Self}`" ,
158
+ label = "expected an `{Trait} ` closure, found `{Self}`"
159
+ ) ) ]
160
160
#[ fundamental] // so that regex can rely that `&str: !FnMut`
161
161
#[ must_use = "closures are lazy and do nothing unless called" ]
162
162
// FIXME(effects) #[const_trait]
@@ -222,7 +222,7 @@ pub trait FnMut<Args: Tuple>: FnOnce<Args> {
222
222
#[ lang = "fn_once" ]
223
223
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
224
224
#[ rustc_paren_sugar]
225
- #[ rustc_on_unimplemented(
225
+ #[ cfg_attr ( not ( bootstrap ) , rustc_on_unimplemented(
226
226
on(
227
227
Args = "()" ,
228
228
note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}`"
@@ -233,9 +233,9 @@ pub trait FnMut<Args: Tuple>: FnOnce<Args> {
233
233
// SAFETY: tidy is not smart enough to tell that the below unsafe block is a string
234
234
label = "call the function in a closure: `|| unsafe {{ /* code */ }}`"
235
235
) ,
236
- message = "expected a `{FnOnce}<{Args}> ` closure, found `{Self}`" ,
237
- label = "expected an `FnOnce<{Args}> ` closure, found `{Self}`"
238
- ) ]
236
+ message = "expected a `{Trait} ` closure, found `{Self}`" ,
237
+ label = "expected an `{Trait} ` closure, found `{Self}`"
238
+ ) ) ]
239
239
#[ fundamental] // so that regex can rely that `&str: !FnMut`
240
240
#[ must_use = "closures are lazy and do nothing unless called" ]
241
241
// FIXME(effects) #[const_trait]
0 commit comments