@@ -86,6 +86,7 @@ pub trait Add<Rhs = Self> {
86
86
/// assert_eq!(12 + 1, 13);
87
87
/// ```
88
88
#[ must_use = "this returns the result of the operation, without modifying the original" ]
89
+ #[ track_caller]
89
90
#[ rustc_diagnostic_item = "add" ]
90
91
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
91
92
fn add ( self , rhs : Rhs ) -> Self :: Output ;
@@ -194,6 +195,7 @@ pub trait Sub<Rhs = Self> {
194
195
/// assert_eq!(12 - 1, 11);
195
196
/// ```
196
197
#[ must_use = "this returns the result of the operation, without modifying the original" ]
198
+ #[ track_caller]
197
199
#[ rustc_diagnostic_item = "sub" ]
198
200
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
199
201
fn sub ( self , rhs : Rhs ) -> Self :: Output ;
@@ -323,6 +325,7 @@ pub trait Mul<Rhs = Self> {
323
325
/// assert_eq!(12 * 2, 24);
324
326
/// ```
325
327
#[ must_use = "this returns the result of the operation, without modifying the original" ]
328
+ #[ track_caller]
326
329
#[ rustc_diagnostic_item = "mul" ]
327
330
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
328
331
fn mul ( self , rhs : Rhs ) -> Self :: Output ;
@@ -456,6 +459,7 @@ pub trait Div<Rhs = Self> {
456
459
/// assert_eq!(12 / 2, 6);
457
460
/// ```
458
461
#[ must_use = "this returns the result of the operation, without modifying the original" ]
462
+ #[ track_caller]
459
463
#[ rustc_diagnostic_item = "div" ]
460
464
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
461
465
fn div ( self , rhs : Rhs ) -> Self :: Output ;
@@ -557,6 +561,7 @@ pub trait Rem<Rhs = Self> {
557
561
/// assert_eq!(12 % 10, 2);
558
562
/// ```
559
563
#[ must_use = "this returns the result of the operation, without modifying the original" ]
564
+ #[ track_caller]
560
565
#[ rustc_diagnostic_item = "rem" ]
561
566
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
562
567
fn rem ( self , rhs : Rhs ) -> Self :: Output ;
@@ -740,6 +745,7 @@ pub trait AddAssign<Rhs = Self> {
740
745
/// x += 1;
741
746
/// assert_eq!(x, 13);
742
747
/// ```
748
+ #[ track_caller]
743
749
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
744
750
fn add_assign ( & mut self , rhs : Rhs ) ;
745
751
}
@@ -806,6 +812,7 @@ pub trait SubAssign<Rhs = Self> {
806
812
/// x -= 1;
807
813
/// assert_eq!(x, 11);
808
814
/// ```
815
+ #[ track_caller]
809
816
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
810
817
fn sub_assign ( & mut self , rhs : Rhs ) ;
811
818
}
@@ -863,6 +870,7 @@ pub trait MulAssign<Rhs = Self> {
863
870
/// x *= 2;
864
871
/// assert_eq!(x, 24);
865
872
/// ```
873
+ #[ track_caller]
866
874
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
867
875
fn mul_assign ( & mut self , rhs : Rhs ) ;
868
876
}
@@ -920,6 +928,7 @@ pub trait DivAssign<Rhs = Self> {
920
928
/// x /= 2;
921
929
/// assert_eq!(x, 6);
922
930
/// ```
931
+ #[ track_caller]
923
932
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
924
933
fn div_assign ( & mut self , rhs : Rhs ) ;
925
934
}
@@ -980,6 +989,7 @@ pub trait RemAssign<Rhs = Self> {
980
989
/// x %= 10;
981
990
/// assert_eq!(x, 2);
982
991
/// ```
992
+ #[ track_caller]
983
993
#[ stable( feature = "op_assign_traits" , since = "1.8.0" ) ]
984
994
fn rem_assign ( & mut self , rhs : Rhs ) ;
985
995
}
0 commit comments