]>
Commit | Line | Data |
---|---|---|
62682a34 SL |
1 | // Test that we can't declare a const fn in an impl -- right now it's |
2 | // just not allowed at all, though eventually it'd make sense to allow | |
3 | // it if the trait fn is const (but right now no trait fns can be | |
4 | // const). | |
85aaf69f | 5 | |
62682a34 SL |
6 | trait Foo { |
7 | fn f() -> u32; | |
8 | } | |
9 | ||
10 | impl Foo for u32 { | |
74b04a01 XL |
11 | const fn f() -> u32 { |
12 | //~^ ERROR functions in traits cannot be declared const | |
13 | 22 | |
14 | } | |
62682a34 SL |
15 | } |
16 | ||
74b04a01 | 17 | fn main() {} |