]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/issue-46553.rs
Rollup merge of #106949 - compiler-errors:is-poly, r=BoxyUwU
[rust.git] / tests / ui / consts / issue-46553.rs
1 // run-pass
2
3 pub struct Data<T> {
4     function: fn() -> T,
5 }
6
7 impl<T> Data<T> {
8     pub const fn new(function: fn() -> T) -> Data<T> {
9         Data {
10             function: function,
11         }
12     }
13 }
14
15 pub static DATA: Data<i32> = Data::new(|| {
16     413i32
17 });
18
19 fn main() {
20     print!("{:?}", (DATA.function)());
21 }