Skip to content

Commit 15b3098

Browse files
committed
Add diagnostic items for Option::unwrap and Option::expect
1 parent 19ca569 commit 15b3098

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

compiler/rustc_span/src/symbol.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,9 @@ symbols! {
10611061
optin_builtin_traits,
10621062
option,
10631063
option_env,
1064+
option_expect,
10641065
option_payload_ptr,
1066+
option_unwrap,
10651067
options,
10661068
or,
10671069
or_patterns,

library/core/src/option.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,7 @@ impl<T> Option<T> {
892892
#[track_caller]
893893
#[stable(feature = "rust1", since = "1.0.0")]
894894
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
895+
#[rustc_diagnostic_item = "option_expect"]
895896
pub const fn expect(self, msg: &str) -> T {
896897
match self {
897898
Some(val) => val,
@@ -929,6 +930,7 @@ impl<T> Option<T> {
929930
#[track_caller]
930931
#[stable(feature = "rust1", since = "1.0.0")]
931932
#[rustc_const_unstable(feature = "const_option", issue = "67441")]
933+
#[rustc_diagnostic_item = "option_unwrap"]
932934
pub const fn unwrap(self) -> T {
933935
match self {
934936
Some(val) => val,

0 commit comments

Comments
 (0)