Skip to content

Commit 7675a50

Browse files
committed
add debug assertion to unreachable_unchecked
1 parent e70e4d4 commit 7675a50

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/hint.rs

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ use crate::intrinsics;
4646
#[stable(feature = "unreachable", since = "1.27.0")]
4747
#[rustc_const_stable(feature = "const_unreachable_unchecked", since = "1.57.0")]
4848
pub const unsafe fn unreachable_unchecked() -> ! {
49+
debug_assert!(false, "entered unreachable code");
4950
// SAFETY: the safety contract for `intrinsics::unreachable` must
5051
// be upheld by the caller.
5152
unsafe { intrinsics::unreachable() }

0 commit comments

Comments
 (0)