Skip to content

Commit

Permalink
Fix must_use on Option::is_none
Browse files Browse the repository at this point in the history
This fixes the `#[must_use = ...]` on `Option::is_none` to have a working suggestion.
  • Loading branch information
mbartlett21 authored May 18, 2021
1 parent 5f10d31 commit 18b0e7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ impl<T> Option<T> {
/// assert_eq!(x.is_none(), true);
/// ```
#[must_use = "if you intended to assert that this doesn't have a value, consider \
`.and_then(|| panic!(\"`Option` had a value when expected `None`\"))` instead"]
`.and_then(|_| panic!(\"`Option` had a value when expected `None`\"))` instead"]
#[inline]
#[rustc_const_stable(feature = "const_option", since = "1.48.0")]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down

0 comments on commit 18b0e7b

Please sign in to comment.