@@ -86,7 +86,8 @@ pub trait Add<Rhs = Self> {
86
86
/// ```
87
87
/// assert_eq!(12 + 1, 13);
88
88
/// ```
89
- #[ must_use]
89
+ #[ must_use = "this returns the result of the operation, without modifying the original" ]
90
+ #[ rustc_diagnostic_item = "add" ]
90
91
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
91
92
fn add ( self , rhs : Rhs ) -> Self :: Output ;
92
93
}
@@ -195,7 +196,8 @@ pub trait Sub<Rhs = Self> {
195
196
/// ```
196
197
/// assert_eq!(12 - 1, 11);
197
198
/// ```
198
- #[ must_use]
199
+ #[ must_use = "this returns the result of the operation, without modifying the original" ]
200
+ #[ rustc_diagnostic_item = "sub" ]
199
201
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
200
202
fn sub ( self , rhs : Rhs ) -> Self :: Output ;
201
203
}
@@ -325,7 +327,8 @@ pub trait Mul<Rhs = Self> {
325
327
/// ```
326
328
/// assert_eq!(12 * 2, 24);
327
329
/// ```
328
- #[ must_use]
330
+ #[ must_use = "this returns the result of the operation, without modifying the original" ]
331
+ #[ rustc_diagnostic_item = "mul" ]
329
332
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
330
333
fn mul ( self , rhs : Rhs ) -> Self :: Output ;
331
334
}
@@ -459,7 +462,8 @@ pub trait Div<Rhs = Self> {
459
462
/// ```
460
463
/// assert_eq!(12 / 2, 6);
461
464
/// ```
462
- #[ must_use]
465
+ #[ must_use = "this returns the result of the operation, without modifying the original" ]
466
+ #[ rustc_diagnostic_item = "div" ]
463
467
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
464
468
fn div ( self , rhs : Rhs ) -> Self :: Output ;
465
469
}
@@ -562,7 +566,8 @@ pub trait Rem<Rhs = Self> {
562
566
/// ```
563
567
/// assert_eq!(12 % 10, 2);
564
568
/// ```
565
- #[ must_use]
569
+ #[ must_use = "this returns the result of the operation, without modifying the original" ]
570
+ #[ rustc_diagnostic_item = "rem" ]
566
571
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
567
572
fn rem ( self , rhs : Rhs ) -> Self :: Output ;
568
573
}
@@ -678,7 +683,8 @@ pub trait Neg {
678
683
/// let x: i32 = 12;
679
684
/// assert_eq!(-x, -12);
680
685
/// ```
681
- #[ must_use]
686
+ #[ must_use = "this returns the result of the operation, without modifying the original" ]
687
+ #[ rustc_diagnostic_item = "neg" ]
682
688
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
683
689
fn neg ( self ) -> Self :: Output ;
684
690
}
0 commit comments