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 @@ -282,6 +282,12 @@ macro_rules! forward_ref_binop {
282
282
/// Point { x: 3, y: 3 });
283
283
/// }
284
284
/// ```
285
+ ///
286
+ /// Note that `RHS = Self` by default, but this is not mandatory. For example,
287
+ /// [std::time::SystemTime] implements `Add<Duration>`, which permits
288
+ /// operations of the form `SystemTime = SystemTime + Duration`.
289
+ ///
290
+ /// [std::time::SystemTime]: ../time/struct.SystemTime.html
285
291
#[ lang = "add" ]
286
292
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
287
293
pub trait Add < RHS =Self > {
@@ -349,6 +355,12 @@ add_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
349
355
/// Point { x: 1, y: 0 });
350
356
/// }
351
357
/// ```
358
+ ///
359
+ /// Note that `RHS = Self` by default, but this is not mandatory. For example,
360
+ /// [std::time::SystemTime] implements `Sub<Duration>`, which permits
361
+ /// operations of the form `SystemTime = SystemTime - Duration`.
362
+ ///
363
+ /// [std::time::SystemTime]: ../time/struct.SystemTime.html
352
364
#[ lang = "sub" ]
353
365
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
354
366
pub trait Sub < RHS =Self > {
You can’t perform that action at this time.
0 commit comments