diff options
Diffstat (limited to 'tests/ui/codegen/subtyping-impacts-selection-2.rs')
| -rw-r--r-- | tests/ui/codegen/subtyping-impacts-selection-2.rs | 12 |
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) +} |
