mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
Rollup merge of #85425 - mbartlett21:patch-1, r=scottmcm
Fix must_use on `Option::is_none` This fixes the `#[must_use = ...]` on `Option::is_none` to have a working suggestion.
This commit is contained in:
commit
e113a4f77b
@ -209,7 +209,7 @@ impl<T> Option<T> {
|
|||||||
/// assert_eq!(x.is_none(), true);
|
/// assert_eq!(x.is_none(), true);
|
||||||
/// ```
|
/// ```
|
||||||
#[must_use = "if you intended to assert that this doesn't have a value, consider \
|
#[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]
|
#[inline]
|
||||||
#[rustc_const_stable(feature = "const_option", since = "1.48.0")]
|
#[rustc_const_stable(feature = "const_option", since = "1.48.0")]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
|
Loading…
Reference in New Issue
Block a user