]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/issue-80772.rs
Rollup merge of #102245 - ink-feather-org:const_cmp_by, r=fee1-dead
[rust.git] / src / test / ui / borrowck / issue-80772.rs
1 // check-pass
2
3 trait SomeTrait {}
4
5 pub struct Exhibit {
6     constant: usize,
7     factory: fn(&usize) -> Box<dyn SomeTrait>,
8 }
9
10 pub const A_CONSTANT: &[Exhibit] = &[
11     Exhibit {
12         constant: 1,
13         factory: |_| unimplemented!(),
14     },
15     Exhibit {
16         constant: "Hello world".len(),
17         factory: |_| unimplemented!(),
18     },
19 ];
20
21 fn main() {}