Skip to content

Commit

Permalink
Rollup merge of #90936 - JohnTitor:issue-80772, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Add a regression test for #80772

Closes #80772
  • Loading branch information
JohnTitor authored Nov 16, 2021
2 parents 3c1d577 + 894c0e4 commit c73b35e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/ui/borrowck/issue-80772.rs
Original file line number Diff line number Diff line change
@@ -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 c73b35e

Please sign in to comment.