use codegen_instance_attrs where an instance is (easily) available

This commit is contained in:
Folkert de Vries
2025-07-02 11:12:54 +02:00
parent ec0ff720d1
commit 9c8ab89187
18 changed files with 43 additions and 26 deletions

View File

@@ -102,7 +102,7 @@ pub(crate) fn get_fn<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, instance: Instance<'t
let is_hidden = if is_generic {
// This is a monomorphization of a generic function.
if !(cx.tcx.sess.opts.share_generics()
|| tcx.codegen_fn_attrs(instance_def_id).inline
|| tcx.codegen_instance_attrs(instance.def).inline
== rustc_attr_data_structures::InlineAttr::Never)
{
// When not sharing generics, all instances are in the same