Sign in
android
/
toolchain
/
rustc
/
89a0a0cd9cbd0a0138a09bd877bbc73859a8c330
/
.
/
src
/
test
/
ui
/
consts
/
const_unsafe_unreachable_ub.rs
blob: b418fea617ceaec29dd407105371ffa2233a4a4b [
file
] [
log
] [
blame
]
// 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
);
}