mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
Add a regression test for #80772
This commit is contained in:
parent
891ca5f63c
commit
894c0e4190
21
src/test/ui/borrowck/issue-80772.rs
Normal file
21
src/test/ui/borrowck/issue-80772.rs
Normal 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() {}
|
Loading…
Reference in New Issue
Block a user