summaryrefslogtreecommitdiffstats
path: root/src/test/ui/borrowck/issue-80772.rs
blob: 1b8caa3f8ac8bfcd4977ab55743a123796c8758a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// check-pass

trait SomeTrait {}

pub struct Exhibit {
    constant: usize,
    factory: fn(&usize) -> Box<dyn SomeTrait>,
}

pub const A_CONSTANT: &[Exhibit] = &[
    Exhibit {
        constant: 1,
        factory: |_| unimplemented!(),
    },
    Exhibit {
        constant: "Hello world".len(),
        factory: |_| unimplemented!(),
    },
];

fn main() {}