Rollup merge of #90936 - JohnTitor:issue-80772, r=Mark-Simulacrum

Add a regression test for #80772

Closes #80772
This commit is contained in:
Yuki Okushi 2021-11-16 15:59:44 +09:00 committed by GitHub
commit c73b35e05d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,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() {}