diff --git a/build_system/tests.rs b/build_system/tests.rs index 6d7ba59183b..08736db8ba0 100644 --- a/build_system/tests.rs +++ b/build_system/tests.rs @@ -92,10 +92,6 @@ const BASE_SYSROOT_SUITE: &[TestCase] = &[ TestCase::build_bin_and_run("aot.mod_bench", "example/mod_bench.rs", &[]), TestCase::build_bin_and_run("aot.issue-72793", "example/issue-72793.rs", &[]), TestCase::build_bin("aot.issue-59326", "example/issue-59326.rs"), - TestCase::custom("aot.polymorphize_coroutine", &|runner| { - runner.run_rustc(&["example/polymorphize_coroutine.rs", "-Zpolymorphize"]); - runner.run_out_command("polymorphize_coroutine", &[]); - }), TestCase::build_bin_and_run("aot.neon", "example/neon.rs", &[]), TestCase::custom("aot.gen_block_iterate", &|runner| { runner.run_rustc([ diff --git a/config.txt b/config.txt index 527ec5303b6..b63597f60fc 100644 --- a/config.txt +++ b/config.txt @@ -42,7 +42,6 @@ aot.float-minmax-pass aot.mod_bench aot.issue-72793 aot.issue-59326 -aot.polymorphize_coroutine aot.neon aot.gen_block_iterate aot.raw-dylib diff --git a/example/polymorphize_coroutine.rs b/example/polymorphize_coroutine.rs deleted file mode 100644 index 407da94c0f0..00000000000 --- a/example/polymorphize_coroutine.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![feature(coroutines, coroutine_trait, stmt_expr_attributes)] - -use std::ops::Coroutine; -use std::pin::Pin; - -fn main() { - run_coroutine::(); -} - -fn run_coroutine() { - let mut coroutine = #[coroutine] - || { - yield; - return; - }; - Pin::new(&mut coroutine).resume(()); -} diff --git a/src/abi/mod.rs b/src/abi/mod.rs index 1c706694dcd..2466bfe60c7 100644 --- a/src/abi/mod.rs +++ b/src/abi/mod.rs @@ -394,8 +394,7 @@ pub(crate) fn codegen_terminator_call<'tcx>( def_id, fn_args, source_info.span, - ) - .polymorphize(fx.tcx); + ); if is_call_from_compiler_builtins_to_upstream_monomorphization(fx.tcx, instance) { if target.is_some() { @@ -698,7 +697,7 @@ pub(crate) fn codegen_drop<'tcx>( target: BasicBlock, ) { let ty = drop_place.layout().ty; - let drop_instance = Instance::resolve_drop_in_place(fx.tcx, ty).polymorphize(fx.tcx); + let drop_instance = Instance::resolve_drop_in_place(fx.tcx, ty); if let ty::InstanceKind::DropGlue(_, None) | ty::InstanceKind::AsyncDropGlueCtorShim(_, None) = drop_instance.def diff --git a/src/base.rs b/src/base.rs index 85cf4c7361a..34066eb83fc 100644 --- a/src/base.rs +++ b/src/base.rs @@ -673,8 +673,7 @@ fn codegen_stmt<'tcx>( def_id, args, ) - .unwrap() - .polymorphize(fx.tcx), + .unwrap(), ); let func_addr = fx.bcx.ins().func_addr(fx.pointer_type, func_ref); lval.write_cvalue(fx, CValue::by_val(func_addr, to_layout)); @@ -760,8 +759,7 @@ fn codegen_stmt<'tcx>( def_id, args, ty::ClosureKind::FnOnce, - ) - .polymorphize(fx.tcx); + ); let func_ref = fx.get_function_ref(instance); let func_addr = fx.bcx.ins().func_addr(fx.pointer_type, func_ref); lval.write_cvalue(fx, CValue::by_val(func_addr, lval.layout())); @@ -1087,7 +1085,7 @@ fn codegen_panic_inner<'tcx>( let def_id = fx.tcx.require_lang_item(lang_item, span); - let instance = Instance::mono(fx.tcx, def_id).polymorphize(fx.tcx); + let instance = Instance::mono(fx.tcx, def_id); if is_call_from_compiler_builtins_to_upstream_monomorphization(fx.tcx, instance) { fx.bcx.ins().trap(TrapCode::user(2).unwrap()); diff --git a/src/constant.rs b/src/constant.rs index abe6085b04f..3e7b81a96b6 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -452,8 +452,7 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant let data_id = match reloc_target_alloc { GlobalAlloc::Function { instance, .. } => { assert_eq!(addend, 0); - let func_id = - crate::abi::import_function(tcx, module, instance.polymorphize(tcx)); + let func_id = crate::abi::import_function(tcx, module, instance); let local_func_id = module.declare_func_in_data(func_id, &mut data); data.write_function_addr(offset.bytes() as u32, local_func_id); continue; diff --git a/src/main_shim.rs b/src/main_shim.rs index 2ee4ff5cec7..e480f21b9df 100644 --- a/src/main_shim.rs +++ b/src/main_shim.rs @@ -24,7 +24,7 @@ pub(crate) fn maybe_create_entry_wrapper( }; if main_def_id.is_local() { - let instance = Instance::mono(tcx, main_def_id).polymorphize(tcx); + let instance = Instance::mono(tcx, main_def_id); if module.get_name(tcx.symbol_name(instance).name).is_none() { return; } @@ -75,7 +75,7 @@ pub(crate) fn maybe_create_entry_wrapper( } }; - let instance = Instance::mono(tcx, rust_main_def_id).polymorphize(tcx); + let instance = Instance::mono(tcx, rust_main_def_id); let main_name = tcx.symbol_name(instance).name; let main_sig = get_function_sig(tcx, m.target_config().default_call_conv, instance); @@ -117,8 +117,7 @@ pub(crate) fn maybe_create_entry_wrapper( report.def_id, tcx.mk_args(&[GenericArg::from(main_ret_ty)]), DUMMY_SP, - ) - .polymorphize(tcx); + ); let report_name = tcx.symbol_name(report).name; let report_sig = get_function_sig(tcx, m.target_config().default_call_conv, report); @@ -143,8 +142,7 @@ pub(crate) fn maybe_create_entry_wrapper( start_def_id, tcx.mk_args(&[main_ret_ty.into()]), DUMMY_SP, - ) - .polymorphize(tcx); + ); let start_func_id = import_function(tcx, m, start_instance); let main_val = bcx.ins().func_addr(m.target_config().pointer_type(), main_func_ref); diff --git a/src/value_and_place.rs b/src/value_and_place.rs index 6676e684ca0..c17d1f30fbe 100644 --- a/src/value_and_place.rs +++ b/src/value_and_place.rs @@ -1005,9 +1005,6 @@ pub(crate) fn assert_assignable<'tcx>( } } } - (ty::Param(_), _) | (_, ty::Param(_)) if fx.tcx.sess.opts.unstable_opts.polymorphize => { - // No way to check if it is correct or not with polymorphization enabled - } _ => { assert_eq!( from_ty,