From 18b0e7bf2cc527aae98af62a9d66b26759d84db3 Mon Sep 17 00:00:00 2001 From: mbartlett21 <29034492+mbartlett21@users.noreply.github.com> Date: Tue, 18 May 2021 13:40:26 +1000 Subject: [PATCH] Fix must_use on `Option::is_none` This fixes the `#[must_use = ...]` on `Option::is_none` to have a working suggestion. --- library/core/src/option.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 04551dded8c77..8e8b623c50bdd 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -209,7 +209,7 @@ impl Option { /// 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"] + `.and_then(|_| panic!(\"`Option` had a value when expected `None`\"))` instead"] #[inline] #[rustc_const_stable(feature = "const_option", since = "1.48.0")] #[stable(feature = "rust1", since = "1.0.0")]