]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/const_unsafe_unreachable_ub.rs
3 #![feature(const_unreachable_unchecked)]
5 const unsafe fn foo(x
: bool
) -> bool
{
8 false => std
::hint
::unreachable_unchecked(),
13 const BAR
: bool
= unsafe { foo(false) }
;
16 assert_eq
!(BAR
, true);
18 //~| ERROR erroneous constant
19 //~| WARN this was previously accepted by the compiler but is being phased out