mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
23 lines
437 B
Rust
23 lines
437 B
Rust
#![allow(incomplete_features)]
|
|
#![feature(explicit_tail_calls)]
|
|
|
|
const fn f() {
|
|
if false {
|
|
become not_const();
|
|
//~^ error: cannot call non-const fn `not_const` in constant functions
|
|
}
|
|
}
|
|
|
|
const fn g((): ()) {
|
|
if false {
|
|
become yes_const(not_const());
|
|
//~^ error: cannot call non-const fn `not_const` in constant functions
|
|
}
|
|
}
|
|
|
|
fn not_const() {}
|
|
|
|
const fn yes_const((): ()) {}
|
|
|
|
fn main() {}
|