1 // Test use of advanced const fn without the `const_fn` feature gate.
3 const fn foo() -> usize { 0 } // ok
6 const fn foo() -> u32; //~ ERROR const fn is unstable
7 //~| ERROR functions in traits cannot be declared const
8 const fn bar() -> u32 { 0 } //~ ERROR const fn is unstable
9 //~| ERROR functions in traits cannot be declared const
13 const fn foo() -> u32 { 0 } //~ ERROR functions in traits cannot be declared const
19 const fn baz() -> u32 { 0 } // ok
22 static FOO: usize = foo();
23 const BAR: usize = foo();
25 macro_rules! constant {
26 ($n:ident: $t:ty = $v:expr) => {
36 let x: [usize; foo()] = [];