Skip to content

Commit

Permalink
Rollup merge of rust-lang#90936 - JohnTitor:issue-80772, r=Mark-Simul…
Browse files Browse the repository at this point in the history
…acrum

Add a regression test for rust-lang#80772

Closes rust-lang#80772
  • Loading branch information
JohnTitor authored Nov 16, 2021
2 parents fcf5bf8 + 894c0e4 commit 9e7bbfd
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 9e7bbfd

Please sign in to comment.