summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-fn-val.rs
blob: e5bf4757e3a7a13de08d0721d313094f76445244 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// run-pass
#![allow(non_upper_case_globals)]
#![allow(overflowing_literals)]

fn foo() -> isize {
    return 0xca7f000d;
}

struct Bar<F> where F: FnMut() -> isize { f: F }

static mut b : Bar<fn() -> isize> = Bar { f: foo as fn() -> isize};

pub fn main() {
    unsafe { assert_eq!((b.f)(), 0xca7f000d); }
}