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 @@ -302,6 +302,12 @@ macro_rules! forward_ref_binop {
302
302
/// Point { x: 3, y: 3 });
303
303
/// }
304
304
/// ```
305
+ ///
306
+ /// Note that `RHS = Self` by default, but this is not mandatory. For example,
307
+ /// [std::time::SystemTime] implements `Add<Duration>`, which permits
308
+ /// operations of the form `SystemTime = SystemTime + Duration`.
309
+ ///
310
+ /// [std::time::SystemTime]: ../../std/time/struct.SystemTime.html
305
311
#[ lang = "add" ]
306
312
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
307
313
pub trait Add < RHS =Self > {
@@ -369,6 +375,12 @@ add_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
369
375
/// Point { x: 1, y: 0 });
370
376
/// }
371
377
/// ```
378
+ ///
379
+ /// Note that `RHS = Self` by default, but this is not mandatory. For example,
380
+ /// [std::time::SystemTime] implements `Sub<Duration>`, which permits
381
+ /// operations of the form `SystemTime = SystemTime - Duration`.
382
+ ///
383
+ /// [std::time::SystemTime]: ../../std/time/struct.SystemTime.html
372
384
#[ lang = "sub" ]
373
385
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
374
386
pub trait Sub < RHS =Self > {
You can’t perform that action at this time.
0 commit comments