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 @@ -187,6 +187,12 @@ macro_rules! forward_ref_binop {
187187/// Foo + Foo;
188188/// }
189189/// ```
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
190196#[ lang = "add" ]
191197#[ stable( feature = "rust1" , since = "1.0.0" ) ]
192198pub trait Add < RHS =Self > {
@@ -241,6 +247,12 @@ add_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }
241247/// Foo - Foo;
242248/// }
243249/// ```
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
244256#[ lang = "sub" ]
245257#[ stable( feature = "rust1" , since = "1.0.0" ) ]
246258pub trait Sub < RHS =Self > {
You can’t perform that action at this time.
0 commit comments