// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // 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). #![feature(const_fn)] trait Foo { fn f() -> u32; } impl Foo for u32 { const fn f() -> u32 { 22 } //~^ ERROR trait fns cannot be declared const //~| NOTE trait fns cannot be const } fn main() { }