File tree Expand file tree Collapse file tree 4 files changed +4
-1
lines changed Expand file tree Collapse file tree 4 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ pub trait ToOwned {
5959 /// let vv: Vec<i32> = v.to_owned();
6060 /// ```
6161 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
62+ #[ must_use = "cloning is often expensive and is not expected to have side effects" ]
6263 fn to_owned ( & self ) -> Self :: Owned ;
6364
6465 /// 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 {
105105 /// assert_eq!("Hello", hello.clone());
106106 /// ```
107107 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
108+ #[ must_use = "cloning is often expensive and is not expected to have side effects" ]
108109 fn clone ( & self ) -> Self ;
109110
110111 /// Performs copy-assignment from `source`.
Original file line number Diff line number Diff line change @@ -1368,6 +1368,7 @@ pub trait Iterator {
13681368 /// [`Result`]: ../../std/result/enum.Result.html
13691369 #[ inline]
13701370 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1371+ #[ must_use = "if you really need to exhaust the iterator, consider `.for_each(drop)` instead" ]
13711372 fn collect < B : FromIterator < Self :: Item > > ( self ) -> B where Self : Sized {
13721373 FromIterator :: from_iter ( self )
13731374 }
Original file line number Diff line number Diff line change @@ -317,7 +317,7 @@ newtype_index!(ScopeId);
317317/// macro (and methods below) makes working with `BlockAnd` much more
318318/// convenient.
319319
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" ]
321321struct BlockAnd < T > ( BasicBlock , T ) ;
322322
323323trait BlockAndExtension {
You can’t perform that action at this time.
0 commit comments