mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-01 01:26:32 +00:00
18 lines
220 B
Rust
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
|
|
}
|