File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,12 @@ macro_rules! forward_ref_binop {
211
211
/// Point { x: 3, y: 3 });
212
212
/// }
213
213
/// ```
214
+ ///
215
+ /// Note that `RHS = Self` by default, but this is not mandatory. For example,
216
+ /// [std::time::SystemTime] implements `Add<Duration>`, which permits
217
+ /// operations of the form `SystemTime = SystemTime + Duration`.
218
+ ///
219
+ /// [std::time::SystemTime]: ../../time/struct.SystemTime.html
214
220
#[ lang = "add" ]
215
221
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
216
222
pub trait Add < RHS =Self > {
@@ -265,6 +271,12 @@ add_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
265
271
/// Foo - Foo;
266
272
/// }
267
273
/// ```
274
+ ///
275
+ /// Note that `RHS = Self` by default, but this is not mandatory. For example,
276
+ /// [std::time::SystemTime] implements `Sub<Duration>`, which permits
277
+ /// operations of the form `SystemTime = SystemTime - Duration`.
278
+ ///
279
+ /// [std::time::SystemTime]: ../../time/struct.SystemTime.html
268
280
#[ lang = "sub" ]
269
281
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
270
282
pub trait Sub < RHS =Self > {
You can’t perform that action at this time.
0 commit comments