summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/issue-80772.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/borrowck/issue-80772.rs')
-rw-r--r--tests/ui/borrowck/issue-80772.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/borrowck/issue-80772.rs b/tests/ui/borrowck/issue-80772.rs
new file mode 100644
index 000000000..1b8caa3f8
--- /dev/null
+++ b/tests/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() {}