rust/src/test/run-pass/const-fn-val.rs

11 lines
156 B
Rust
Raw Normal View History

fn foo() -> int {
return 0xca7f000d;
}
struct Bar { f: &fn() -> int }
const b : Bar = Bar { f: foo };
fn main() {
assert (b.f)() == 0xca7f000d;
}