2018-05-08 10:29:09 -05:00
|
|
|
// test that certain things are disallowed in constant functions
|
2015-10-14 05:30:10 -05:00
|
|
|
|
|
|
|
#![feature(const_fn)]
|
|
|
|
|
|
|
|
// no destructuring
|
2016-05-02 17:57:35 -05:00
|
|
|
const fn i((
|
2018-05-08 06:59:26 -05:00
|
|
|
a,
|
|
|
|
//~^ ERROR arguments of constant functions can only be immutable by-value bindings
|
|
|
|
b
|
|
|
|
//~^ ERROR arguments of constant functions can only be immutable by-value bindings
|
2016-05-02 17:57:35 -05:00
|
|
|
): (u32, u32)) -> u32 {
|
|
|
|
a + b
|
2018-05-08 06:59:26 -05:00
|
|
|
//~^ ERROR let bindings in constant functions are unstable
|
|
|
|
//~| ERROR let bindings in constant functions are unstable
|
2016-05-02 17:57:35 -05:00
|
|
|
}
|
2015-10-14 05:30:10 -05:00
|
|
|
|
|
|
|
fn main() {}
|