diff options
Diffstat (limited to 'src/test/ui/consts/const_unsafe_unreachable_ub.rs')
-rw-r--r-- | src/test/ui/consts/const_unsafe_unreachable_ub.rs | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/test/ui/consts/const_unsafe_unreachable_ub.rs b/src/test/ui/consts/const_unsafe_unreachable_ub.rs deleted file mode 100644 index b418fea61..000000000 --- a/src/test/ui/consts/const_unsafe_unreachable_ub.rs +++ /dev/null @@ -1,14 +0,0 @@ -// error-pattern: evaluation of constant value failed - -const unsafe fn foo(x: bool) -> bool { - match x { - true => true, - false => std::hint::unreachable_unchecked(), - } -} - -const BAR: bool = unsafe { foo(false) }; - -fn main() { - assert_eq!(BAR, true); -} |