File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,12 @@ macro_rules! forward_ref_binop {
187
187
/// Foo + Foo;
188
188
/// }
189
189
/// ```
190
+ ///
191
+ /// Note that `RHS = Self` by default, but this is not mandatory. For example,
192
+ /// [std::time::SystemTime] implements `Add<Duration>`, which permits
193
+ /// operations of the form `SystemTime = SystemTime + Duration`.
194
+ ///
195
+ /// [std::time::SystemTime]: ../../time/struct.SystemTime.html
190
196
#[ lang = "add" ]
191
197
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
192
198
pub trait Add < RHS =Self > {
@@ -241,6 +247,12 @@ add_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
241
247
/// Foo - Foo;
242
248
/// }
243
249
/// ```
250
+ ///
251
+ /// Note that `RHS = Self` by default, but this is not mandatory. For example,
252
+ /// [std::time::SystemTime] implements `Sub<Duration>`, which permits
253
+ /// operations of the form `SystemTime = SystemTime - Duration`.
254
+ ///
255
+ /// [std::time::SystemTime]: ../../time/struct.SystemTime.html
244
256
#[ lang = "sub" ]
245
257
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
246
258
pub trait Sub < RHS =Self > {
You can’t perform that action at this time.
0 commit comments