about summary refs log tree commit diff
path: root/tests/ui/codegen/subtyping-impacts-selection-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/codegen/subtyping-impacts-selection-2.rs')
-rw-r--r--tests/ui/codegen/subtyping-impacts-selection-2.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/codegen/subtyping-impacts-selection-2.rs b/tests/ui/codegen/subtyping-impacts-selection-2.rs
new file mode 100644
index 00000000000..921136775b7
--- /dev/null
+++ b/tests/ui/codegen/subtyping-impacts-selection-2.rs
@@ -0,0 +1,12 @@
+// run-pass
+// revisions: mir codegen
+//[mir] compile-flags: -Zmir-opt-level=3
+//[codegen] compile-flags: -Zmir-opt-level=0
+
+// A regression test for #107205
+
+const X: for<'b> fn(&'b ()) = |&()| ();
+fn main() {
+    let dyn_debug = Box::new(X) as Box<fn(&'static ())> as Box<dyn Send>;
+    drop(dyn_debug)
+}