chore: suggest wrapping in an assert!()
instead
This shortens the `#[must_use]` diagnostics displayed, in light of the [review comment](https://github.com/rust-lang/rust/pull/62431/files#r300819839) on when this was originally added.
This commit is contained in:
parent
867d39cdf6
commit
1821bfaa09
@ -642,7 +642,7 @@ pub fn is_some_and(self, f: impl FnOnce(T) -> bool) -> bool {
|
||||
/// 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"]
|
||||
wrapping this in an `assert!()` instead"]
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[rustc_const_stable(feature = "const_option_basics", since = "1.48.0")]
|
||||
|
Loading…
Reference in New Issue
Block a user