From a0a801cd3807498bdf6b0d7fd4148fdff9ede4b1 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Wed, 13 Sep 2023 13:55:23 +0000 Subject: treat host effect params as erased generics in codegen This fixes the changes brought to codegen tests when effect params are added to libcore, by not attempting to monomorphize functions that get the host param by being `const fn`. --- compiler/rustc_mir_transform/src/inline.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_mir_transform/src') diff --git a/compiler/rustc_mir_transform/src/inline.rs b/compiler/rustc_mir_transform/src/inline.rs index 7d4c4a823a8..4dc7c3b6444 100644 --- a/compiler/rustc_mir_transform/src/inline.rs +++ b/compiler/rustc_mir_transform/src/inline.rs @@ -390,7 +390,12 @@ impl<'tcx> Inliner<'tcx> { // Reachability pass defines which functions are eligible for inlining. Generally inlining // other functions is incorrect because they could reference symbols that aren't exported. - let is_generic = callsite.callee.args.non_erasable_generics().next().is_some(); + let is_generic = callsite + .callee + .args + .non_erasable_generics(self.tcx, callsite.callee.def_id()) + .next() + .is_some(); if !is_generic && !callee_attrs.requests_inline() { return Err("not exported"); } -- cgit 1.4.1-3-g733a5