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 @@ -212,6 +212,12 @@ macro_rules! forward_ref_binop {
212
212
/// Point { x: 3, y: 3 });
213
213
/// }
214
214
/// ```
215
+ ///
216
+ /// Note that `RHS = Self` by default, but this is not mandatory. For example,
217
+ /// [std::time::SystemTime] implements `Add<Duration>`, which permits
218
+ /// operations of the form `SystemTime = SystemTime + Duration`.
219
+ ///
220
+ /// [std::time::SystemTime]: ../time/struct.SystemTime.html
215
221
#[ lang = "add" ]
216
222
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
217
223
pub trait Add < RHS =Self > {
@@ -279,6 +285,12 @@ add_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
279
285
/// Point { x: 1, y: 0 });
280
286
/// }
281
287
/// ```
288
+ ///
289
+ /// Note that `RHS = Self` by default, but this is not mandatory. For example,
290
+ /// [std::time::SystemTime] implements `Sub<Duration>`, which permits
291
+ /// operations of the form `SystemTime = SystemTime - Duration`.
292
+ ///
293
+ /// [std::time::SystemTime]: ../time/struct.SystemTime.html
282
294
#[ lang = "sub" ]
283
295
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
284
296
pub trait Sub < RHS =Self > {
You can’t perform that action at this time.
0 commit comments