blob: e21a532effd1d72e6e2e676222a5b3fdc644383d [file] [log] [blame]
// run-pass
#![feature(const_fn)]
#![deny(const_err)]
pub struct Data<T> {
function: fn() -> T,
}
impl<T> Data<T> {
pub const fn new(function: fn() -> T) -> Data<T> {
Data {
function: function,
}
}
}
pub static DATA: Data<i32> = Data::new(|| {
413i32
});
fn main() {
print!("{:?}", (DATA.function)());
}