|
65 | 65 | /// ``` |
66 | 66 | #[lang = "add"] |
67 | 67 | #[stable(feature = "rust1", since = "1.0.0")] |
68 | | -#[cfg_attr( |
69 | | - bootstrap, |
70 | | - rustc_on_unimplemented( |
71 | | - on( |
72 | | - all(_Self = "{integer}", Rhs = "{float}"), |
73 | | - message = "cannot add a float to an integer", |
74 | | - ), |
75 | | - on( |
76 | | - all(_Self = "{float}", Rhs = "{integer}"), |
77 | | - message = "cannot add an integer to a float", |
78 | | - ), |
79 | | - message = "cannot add `{Rhs}` to `{Self}`", |
80 | | - label = "no implementation for `{Self} + {Rhs}`" |
81 | | - ) |
82 | | -)] |
83 | | -#[cfg_attr( |
84 | | - not(bootstrap), |
85 | | - rustc_on_unimplemented( |
86 | | - on( |
87 | | - all(_Self = "{integer}", Rhs = "{float}"), |
88 | | - message = "cannot add a float to an integer", |
89 | | - ), |
90 | | - on( |
91 | | - all(_Self = "{float}", Rhs = "{integer}"), |
92 | | - message = "cannot add an integer to a float", |
93 | | - ), |
94 | | - message = "cannot add `{Rhs}` to `{Self}`", |
95 | | - label = "no implementation for `{Self} + {Rhs}`", |
96 | | - append_const_msg, |
97 | | - ) |
| 68 | +#[rustc_on_unimplemented( |
| 69 | + on(all(_Self = "{integer}", Rhs = "{float}"), message = "cannot add a float to an integer",), |
| 70 | + on(all(_Self = "{float}", Rhs = "{integer}"), message = "cannot add an integer to a float",), |
| 71 | + message = "cannot add `{Rhs}` to `{Self}`", |
| 72 | + label = "no implementation for `{Self} + {Rhs}`", |
| 73 | + append_const_msg |
98 | 74 | )] |
99 | 75 | #[doc(alias = "+")] |
100 | 76 | #[const_trait] |
@@ -202,7 +178,8 @@ add_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 } |
202 | 178 | #[stable(feature = "rust1", since = "1.0.0")] |
203 | 179 | #[rustc_on_unimplemented( |
204 | 180 | message = "cannot subtract `{Rhs}` from `{Self}`", |
205 | | - label = "no implementation for `{Self} - {Rhs}`" |
| 181 | + label = "no implementation for `{Self} - {Rhs}`", |
| 182 | + append_const_msg |
206 | 183 | )] |
207 | 184 | #[doc(alias = "-")] |
208 | 185 | #[const_trait] |
|
0 commit comments