rust/tests/ui/borrowck/issue-80772.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
363 B
Rust
Raw Normal View History

2021-11-15 18:38:43 -06:00
//@ 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() {}