mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
16 lines
311 B
Rust
16 lines
311 B
Rust
//@ 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); }
|
|
}
|