1
Fork 0

Auto merge of #115817 - fee1-dead-contrib:fix-codegen, r=oli-obk

treat host effect params as erased 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`.

r? `@oli-obk`
This commit is contained in:
bors 2023-09-14 13:42:30 +00:00
commit 5e71913156
17 changed files with 71 additions and 41 deletions

View file

@ -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");
}