File tree 4 files changed +4
-1
lines changed
4 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ pub trait ToOwned {
59
59
/// let vv: Vec<i32> = v.to_owned();
60
60
/// ```
61
61
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
62
+ #[ must_use = "cloning is often expensive and is not expected to have side effects" ]
62
63
fn to_owned ( & self ) -> Self :: Owned ;
63
64
64
65
/// Uses borrowed data to replace owned data, usually by cloning.
Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ pub trait Clone : Sized {
105
105
/// assert_eq!("Hello", hello.clone());
106
106
/// ```
107
107
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
108
+ #[ must_use = "cloning is often expensive and is not expected to have side effects" ]
108
109
fn clone ( & self ) -> Self ;
109
110
110
111
/// Performs copy-assignment from `source`.
Original file line number Diff line number Diff line change @@ -1368,6 +1368,7 @@ pub trait Iterator {
1368
1368
/// [`Result`]: ../../std/result/enum.Result.html
1369
1369
#[ inline]
1370
1370
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1371
+ #[ must_use = "if you really need to exhaust the iterator, consider `.for_each(drop)` instead" ]
1371
1372
fn collect < B : FromIterator < Self :: Item > > ( self ) -> B where Self : Sized {
1372
1373
FromIterator :: from_iter ( self )
1373
1374
}
Original file line number Diff line number Diff line change @@ -317,7 +317,7 @@ newtype_index!(ScopeId);
317
317
/// macro (and methods below) makes working with `BlockAnd` much more
318
318
/// convenient.
319
319
320
- #[ must_use] // if you don't use one of these results, you're leaving a dangling edge
320
+ #[ must_use = " if you don't use one of these results, you're leaving a dangling edge" ]
321
321
struct BlockAnd < T > ( BasicBlock , T ) ;
322
322
323
323
trait BlockAndExtension {
You can’t perform that action at this time.
0 commit comments