2015-05-05 07:47:04 -05:00
|
|
|
// Test that we can't declare a const fn in an impl -- right now it's
|
|
|
|
// just not allowed at all, though eventually it'd make sense to allow
|
|
|
|
// it if the trait fn is const (but right now no trait fns can be
|
|
|
|
// const).
|
|
|
|
|
|
|
|
trait Foo {
|
|
|
|
fn f() -> u32;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Foo for u32 {
|
2020-02-11 01:19:21 -06:00
|
|
|
const fn f() -> u32 {
|
|
|
|
//~^ ERROR functions in traits cannot be declared const
|
|
|
|
22
|
|
|
|
}
|
2015-05-05 07:47:04 -05:00
|
|
|
}
|
|
|
|
|
2020-02-11 01:19:21 -06:00
|
|
|
fn main() {}
|