Skip to content

Commit 1abed9c

Browse files
committedMay 7, 2018
Add explanation for #[must_use] on Result
1 parent 6288970 commit 1abed9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/libcore/result.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ use ops;
251251
/// [`Ok`]: enum.Result.html#variant.Ok
252252
/// [`Err`]: enum.Result.html#variant.Err
253253
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
254-
#[must_use]
254+
#[must_use = "this `Result` may be an `Err` variant, which should be handled"]
255255
#[stable(feature = "rust1", since = "1.0.0")]
256256
pub enum Result<T, E> {
257257
/// Contains the success value

0 commit comments

Comments
 (0)