1
1
/// The addition operator `+`.
2
2
///
3
- /// Note that `RHS ` is `Self` by default, but this is not mandatory. For
3
+ /// Note that `Rhs ` is `Self` by default, but this is not mandatory. For
4
4
/// example, [`std::time::SystemTime`] implements `Add<Duration>`, which permits
5
5
/// operations of the form `SystemTime = SystemTime + Duration`.
6
6
///
67
67
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
68
68
#[ rustc_on_unimplemented(
69
69
on(
70
- all( _Self="{integer}" , RHS ="{float}" ) ,
70
+ all( _Self="{integer}" , Rhs ="{float}" ) ,
71
71
message="cannot add a float to an integer" ,
72
72
) ,
73
73
on(
74
- all( _Self="{float}" , RHS ="{integer}" ) ,
74
+ all( _Self="{float}" , Rhs ="{integer}" ) ,
75
75
message="cannot add an integer to a float" ,
76
76
) ,
77
- message="cannot add `{RHS }` to `{Self}`" ,
78
- label="no implementation for `{Self} + {RHS }`" ,
77
+ message="cannot add `{Rhs }` to `{Self}`" ,
78
+ label="no implementation for `{Self} + {Rhs }`" ,
79
79
) ]
80
80
#[ doc( alias = "+" ) ]
81
- pub trait Add < RHS =Self > {
81
+ pub trait Add < Rhs =Self > {
82
82
/// The resulting type after applying the `+` operator.
83
83
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
84
84
type Output ;
85
85
86
86
/// Performs the `+` operation.
87
87
#[ must_use]
88
88
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
89
- fn add ( self , rhs : RHS ) -> Self :: Output ;
89
+ fn add ( self , rhs : Rhs ) -> Self :: Output ;
90
90
}
91
91
92
92
macro_rules! add_impl {
@@ -108,7 +108,7 @@ add_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
108
108
109
109
/// The subtraction operator `-`.
110
110
///
111
- /// Note that `RHS ` is `Self` by default, but this is not mandatory. For
111
+ /// Note that `Rhs ` is `Self` by default, but this is not mandatory. For
112
112
/// example, [`std::time::SystemTime`] implements `Sub<Duration>`, which permits
113
113
/// operations of the form `SystemTime = SystemTime - Duration`.
114
114
///
@@ -173,18 +173,18 @@ add_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
173
173
/// ```
174
174
#[ lang = "sub" ]
175
175
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
176
- #[ rustc_on_unimplemented( message="cannot subtract `{RHS }` from `{Self}`" ,
177
- label="no implementation for `{Self} - {RHS }`" ) ]
176
+ #[ rustc_on_unimplemented( message="cannot subtract `{Rhs }` from `{Self}`" ,
177
+ label="no implementation for `{Self} - {Rhs }`" ) ]
178
178
#[ doc( alias = "-" ) ]
179
- pub trait Sub < RHS =Self > {
179
+ pub trait Sub < Rhs =Self > {
180
180
/// The resulting type after applying the `-` operator.
181
181
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
182
182
type Output ;
183
183
184
184
/// Performs the `-` operation.
185
185
#[ must_use]
186
186
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
187
- fn sub ( self , rhs : RHS ) -> Self :: Output ;
187
+ fn sub ( self , rhs : Rhs ) -> Self :: Output ;
188
188
}
189
189
190
190
macro_rules! sub_impl {
@@ -206,7 +206,7 @@ sub_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
206
206
207
207
/// The multiplication operator `*`.
208
208
///
209
- /// Note that `RHS ` is `Self` by default, but this is not mandatory.
209
+ /// Note that `Rhs ` is `Self` by default, but this is not mandatory.
210
210
///
211
211
/// # Examples
212
212
///
@@ -293,18 +293,18 @@ sub_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
293
293
/// ```
294
294
#[ lang = "mul" ]
295
295
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
296
- #[ rustc_on_unimplemented( message="cannot multiply `{RHS }` to `{Self}`" ,
297
- label="no implementation for `{Self} * {RHS }`" ) ]
296
+ #[ rustc_on_unimplemented( message="cannot multiply `{Rhs }` to `{Self}`" ,
297
+ label="no implementation for `{Self} * {Rhs }`" ) ]
298
298
#[ doc( alias = "*" ) ]
299
- pub trait Mul < RHS =Self > {
299
+ pub trait Mul < Rhs =Self > {
300
300
/// The resulting type after applying the `*` operator.
301
301
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
302
302
type Output ;
303
303
304
304
/// Performs the `*` operation.
305
305
#[ must_use]
306
306
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
307
- fn mul ( self , rhs : RHS ) -> Self :: Output ;
307
+ fn mul ( self , rhs : Rhs ) -> Self :: Output ;
308
308
}
309
309
310
310
macro_rules! mul_impl {
@@ -326,7 +326,7 @@ mul_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
326
326
327
327
/// The division operator `/`.
328
328
///
329
- /// Note that `RHS ` is `Self` by default, but this is not mandatory.
329
+ /// Note that `Rhs ` is `Self` by default, but this is not mandatory.
330
330
///
331
331
/// # Examples
332
332
///
@@ -417,18 +417,18 @@ mul_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
417
417
/// ```
418
418
#[ lang = "div" ]
419
419
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
420
- #[ rustc_on_unimplemented( message="cannot divide `{Self}` by `{RHS }`" ,
421
- label="no implementation for `{Self} / {RHS }`" ) ]
420
+ #[ rustc_on_unimplemented( message="cannot divide `{Self}` by `{Rhs }`" ,
421
+ label="no implementation for `{Self} / {Rhs }`" ) ]
422
422
#[ doc( alias = "/" ) ]
423
- pub trait Div < RHS =Self > {
423
+ pub trait Div < Rhs =Self > {
424
424
/// The resulting type after applying the `/` operator.
425
425
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
426
426
type Output ;
427
427
428
428
/// Performs the `/` operation.
429
429
#[ must_use]
430
430
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
431
- fn div ( self , rhs : RHS ) -> Self :: Output ;
431
+ fn div ( self , rhs : Rhs ) -> Self :: Output ;
432
432
}
433
433
434
434
macro_rules! div_impl_integer {
@@ -467,7 +467,7 @@ div_impl_float! { f32 f64 }
467
467
468
468
/// The remainder operator `%`.
469
469
///
470
- /// Note that `RHS ` is `Self` by default, but this is not mandatory.
470
+ /// Note that `Rhs ` is `Self` by default, but this is not mandatory.
471
471
///
472
472
/// # Examples
473
473
///
@@ -502,18 +502,18 @@ div_impl_float! { f32 f64 }
502
502
/// ```
503
503
#[ lang = "rem" ]
504
504
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
505
- #[ rustc_on_unimplemented( message="cannot mod `{Self}` by `{RHS }`" ,
506
- label="no implementation for `{Self} % {RHS }`" ) ]
505
+ #[ rustc_on_unimplemented( message="cannot mod `{Self}` by `{Rhs }`" ,
506
+ label="no implementation for `{Self} % {Rhs }`" ) ]
507
507
#[ doc( alias = "%" ) ]
508
- pub trait Rem < RHS =Self > {
508
+ pub trait Rem < Rhs =Self > {
509
509
/// The resulting type after applying the `%` operator.
510
510
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
511
511
type Output = Self ;
512
512
513
513
/// Performs the `%` operation.
514
514
#[ must_use]
515
515
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
516
- fn rem ( self , rhs : RHS ) -> Self :: Output ;
516
+ fn rem ( self , rhs : Rhs ) -> Self :: Output ;
517
517
}
518
518
519
519
macro_rules! rem_impl_integer {
0 commit comments