Skip to content

Commit 18b0e7b

Browse files
authored
Fix must_use on Option::is_none
This fixes the `#[must_use = ...]` on `Option::is_none` to have a working suggestion.
1 parent 5f10d31 commit 18b0e7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/option.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ impl<T> Option<T> {
209209
/// assert_eq!(x.is_none(), true);
210210
/// ```
211211
#[must_use = "if you intended to assert that this doesn't have a value, consider \
212-
`.and_then(|| panic!(\"`Option` had a value when expected `None`\"))` instead"]
212+
`.and_then(|_| panic!(\"`Option` had a value when expected `None`\"))` instead"]
213213
#[inline]
214214
#[rustc_const_stable(feature = "const_option", since = "1.48.0")]
215215
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)