]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-fn-val.rs
Rollup merge of #106927 - Ezrashaw:e0606-make-machine-applicable, r=estebank
[rust.git] / tests / ui / consts / const-fn-val.rs
1 // run-pass
2 #![allow(non_upper_case_globals)]
3 #![allow(overflowing_literals)]
4
5 fn foo() -> isize {
6     return 0xca7f000d;
7 }
8
9 struct Bar<F> where F: FnMut() -> isize { f: F }
10
11 static mut b : Bar<fn() -> isize> = Bar { f: foo as fn() -> isize};
12
13 pub fn main() {
14     unsafe { assert_eq!((b.f)(), 0xca7f000d); }
15 }