2021-06-18 12:31:56 -05:00
|
|
|
// error-pattern: evaluation of constant value failed
|
2020-07-17 15:03:33 -05:00
|
|
|
|
|
|
|
const unsafe fn foo(x: bool) -> bool {
|
|
|
|
match x {
|
|
|
|
true => true,
|
|
|
|
false => std::hint::unreachable_unchecked(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const BAR: bool = unsafe { foo(false) };
|
|
|
|
|
|
|
|
fn main() {
|
2021-10-04 00:04:17 -05:00
|
|
|
assert_eq!(BAR, true);
|
2020-07-17 15:03:33 -05:00
|
|
|
}
|