about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-01-22 07:56:43 +0100
committerGitHub <noreply@github.com>2024-01-22 07:56:43 +0100
commit1df60b2257d936110415d3aeb5b2ec9261190103 (patch)
treed4e64dc04dfab1d4a3bc6afd95708a89ba903000
parentbef2e85359ac1c826f2259ae8b93b15b7a0d032e (diff)
parent1821bfaa095273523bd06a9e72075962e040daad (diff)
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.
-rw-r--r--library/core/src/option.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/option.rs b/library/core/src/option.rs
index ce29352ba19..c94e7d73a2a 100644
--- a/library/core/src/option.rs
+++ b/library/core/src/option.rs
@@ -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")]