Skip to content

Commit 11341e2

Browse files
committed
Replace unreachable! with unreachable_unchecked
1 parent a646c91 commit 11341e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libcore/option.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
#![stable(feature = "rust1", since = "1.0.0")]
147147

148148
use iter::{FromIterator, FusedIterator, TrustedLen};
149-
use {mem, ops};
149+
use {hint, mem, ops};
150150
use mem::PinMut;
151151

152152
// Note that this is not a lang item per se, but it has a hidden dependency on
@@ -784,7 +784,7 @@ impl<T> Option<T> {
784784

785785
match *self {
786786
Some(ref mut v) => v,
787-
_ => unreachable!(),
787+
None => unsafe { hint::unreachable_unchecked() },
788788
}
789789
}
790790

@@ -817,7 +817,7 @@ impl<T> Option<T> {
817817

818818
match *self {
819819
Some(ref mut v) => v,
820-
_ => unreachable!(),
820+
None => unsafe { hint::unreachable_unchecked() },
821821
}
822822
}
823823

0 commit comments

Comments
 (0)