Skip to content

Commit

Permalink
Unrolled build for rust-lang#120194
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#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.
  • Loading branch information
rust-timer authored Jan 22, 2024
2 parents 6fff796 + 1821bfa commit 98cfdab
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 @@ -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")]
Expand Down

0 comments on commit 98cfdab

Please sign in to comment.