mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Rollup merge of #120194 - HTGAzureX1212:HTGAzureX1212shorten-option-must-use, r=Nilstrieb
Shorten `#[must_use]` Diagnostic Message for `Option::is_none` 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:
commit
1df60b2257
@ -642,7 +642,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"]
|
||||
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