summaryrefslogtreecommitdiffstats
path: root/tests/ui/typeck/type-placeholder-fn-in-const.rs
blob: bbb95a5798af5eca6afd1f6f9260be70a3a6c428 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
struct MyStruct;

trait Test {
    const TEST: fn() -> _;
    //~^ ERROR: the placeholder `_` is not allowed within types on item signatures for functions [E0121]
    //~| ERROR: the placeholder `_` is not allowed within types on item signatures for associated constants [E0121]
}

impl Test for MyStruct {
    const TEST: fn() -> _ = 42;
    //~^ ERROR: the placeholder `_` is not allowed within types on item signatures for functions [E0121]
    //~| ERROR: the placeholder `_` is not allowed within types on item signatures for associated constants [E0121]
}

fn main() {}