about summary refs log tree commit diff
path: root/tests/ui/explicit-tail-calls/constck.rs
blob: 4179fe8caf362e1cee3b072b9e14b45657c3197c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#![expect(incomplete_features)]
#![feature(explicit_tail_calls)]

const fn f() {
    if false {
        become not_const();
        //~^ error: cannot call non-const function `not_const` in constant functions
    }
}

const fn g((): ()) {
    if false {
        become yes_const(not_const());
        //~^ error: cannot call non-const function `not_const` in constant functions
    }
}

fn not_const() {}

const fn yes_const((): ()) {}

fn main() {}