about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2022-02-23 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2022-02-23 22:33:50 +0100
commitf047af24b3b90f19b89fac80822acd69613b89ec (patch)
tree723e234654af638ef0c109257e1e847835015d31 /compiler/rustc_codegen_cranelift
parent532d3cda90b8a729cd982548649d32803d265052 (diff)
downloadrust-f047af24b3b90f19b89fac80822acd69613b89ec.tar.gz
rust-f047af24b3b90f19b89fac80822acd69613b89ec.zip
Normalize main return type during mono item collection & codegen
Diffstat (limited to 'compiler/rustc_codegen_cranelift')
-rw-r--r--compiler/rustc_codegen_cranelift/src/main_shim.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/main_shim.rs b/compiler/rustc_codegen_cranelift/src/main_shim.rs
index 9ce727279c2..2f71a70a449 100644
--- a/compiler/rustc_codegen_cranelift/src/main_shim.rs
+++ b/compiler/rustc_codegen_cranelift/src/main_shim.rs
@@ -51,7 +51,10 @@ pub(crate) fn maybe_create_entry_wrapper(
         // late-bound regions, since late-bound
         // regions must appear in the argument
         // listing.
-        let main_ret_ty = tcx.erase_regions(main_ret_ty.no_bound_vars().unwrap());
+        let main_ret_ty = tcx.normalize_erasing_regions(
+            ty::ParamEnv::reveal_all(),
+            main_ret_ty.no_bound_vars().unwrap(),
+        );
 
         let cmain_sig = Signature {
             params: vec![