Files
rust/tests/ui/comptime/comptime_method.rs
2026-07-14 10:55:00 +02:00

18 lines
220 B
Rust

#![feature(rustc_attrs)]
struct Bar;
#[rustc_comptime]
impl Bar {
fn boo(&self) {}
}
const _: () = {
Bar.boo();
};
fn main() {
Bar.boo();
//~^ ERROR: comptime fns can only be called at compile time
}