diff options
| author | mbartlett21 <29034492+mbartlett21@users.noreply.github.com> | 2021-05-18 13:40:26 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-18 13:40:26 +1000 |
| commit | 18b0e7bf2cc527aae98af62a9d66b26759d84db3 (patch) | |
| tree | 72e162a70419578c947d6f9e1c5d6293d42cd92a | |
| parent | 5f10d310f475b3ba583b9c590b8d19f6c2fde28f (diff) | |
| download | rust-18b0e7bf2cc527aae98af62a9d66b26759d84db3.tar.gz rust-18b0e7bf2cc527aae98af62a9d66b26759d84db3.zip | |
Fix must_use on `Option::is_none`
This fixes the `#[must_use = ...]` on `Option::is_none` to have a working suggestion.
| -rw-r--r-- | library/core/src/option.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 04551dded8c..8e8b623c50b 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -209,7 +209,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"] + `.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")] |
