Skip to content

Commit

Permalink
Add a regression test for #80772
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Nov 16, 2021
1 parent 891ca5f commit 894c0e4
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/ui/borrowck/issue-80772.rs
@@ -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() {}

0 comments on commit 894c0e4

Please sign in to comment.