add test for issue 84957
This commit is contained in:
parent
e1e9319d93
commit
f8b2f91c48
@ -0,0 +1,28 @@
|
||||
// build-pass
|
||||
|
||||
trait Foo {}
|
||||
|
||||
struct Bar {
|
||||
bytes: &'static [u8],
|
||||
func: fn(&Box<dyn Foo>),
|
||||
}
|
||||
fn example(_: &Box<dyn Foo>) {}
|
||||
|
||||
const BARS: &[Bar] = &[
|
||||
Bar {
|
||||
bytes: "0".as_bytes(),
|
||||
func: example,
|
||||
},
|
||||
Bar {
|
||||
bytes: "0".as_bytes(),
|
||||
func: example,
|
||||
},
|
||||
];
|
||||
|
||||
fn main() {
|
||||
let x = todo!();
|
||||
|
||||
for bar in BARS {
|
||||
(bar.func)(&x);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user