blob: be533c1118ed399ebbc97185f989e4bbbfc03b37 [file]
#![feature(rustc_attrs, const_trait_impl)]
#[rustc_comptime]
fn foo() {}
fn main() {
// Ok
const { foo() };
// Not Ok
foo(); //~ ERROR: comptime functions can only be called at compile time
}
const fn bar() {
// Not Ok
foo(); //~ ERROR: comptime functions can only be called at compile time
}
#[rustc_comptime]
fn baz() {
// Ok
foo();
}