2024-11-29 03:28:02 +00:00
|
|
|
#![expect(incomplete_features)]
|
2024-02-15 19:54:37 +00:00
|
|
|
#![feature(explicit_tail_calls)]
|
|
|
|
|
|
|
|
const fn f() {
|
|
|
|
if false {
|
|
|
|
become not_const();
|
2024-12-23 21:49:48 +00:00
|
|
|
//~^ error: cannot call non-const function `not_const` in constant functions
|
2024-02-15 19:54:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const fn g((): ()) {
|
|
|
|
if false {
|
|
|
|
become yes_const(not_const());
|
2024-12-23 21:49:48 +00:00
|
|
|
//~^ error: cannot call non-const function `not_const` in constant functions
|
2024-02-15 19:54:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn not_const() {}
|
|
|
|
|
|
|
|
const fn yes_const((): ()) {}
|
|
|
|
|
|
|
|
fn main() {}
|