add test for issue 84957
This commit is contained in:
parent
e1e9319d93
commit
f8b2f91c48
1 changed files with 28 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue