mirror of
https://github.com/rust-lang/rust.git
synced 2026-01-20 02:10:33 +00:00
Rollup merge of #90936 - JohnTitor:issue-80772, r=Mark-Simulacrum
Add a regression test for #80772 Closes #80772
This commit is contained in:
commit
c73b35e05d
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…
x
Reference in New Issue
Block a user