diff options
| author | lcnr <rust@lcnr.de> | 2023-06-09 13:12:45 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2023-06-19 09:01:29 +0200 |
| commit | c5943307ec68e82bcfcb7604a4ebb2bbab6a0272 (patch) | |
| tree | 1894d66900b0f9f3c0a181ae39fb72bc24078a99 /tests/ui/codegen/subtyping-impacts-selection-2.rs | |
| parent | c911e085144324110b4b51b333e71444861b0d17 (diff) | |
| download | rust-c5943307ec68e82bcfcb7604a4ebb2bbab6a0272.tar.gz rust-c5943307ec68e82bcfcb7604a4ebb2bbab6a0272.zip | |
add tests for unsound subtype handling
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) +} |
