Rollup merge of #141511 - Noratrieb:codegen-fn-attrs, r=compiler-errors

Cleanup CodegenFnAttrFlags

- Rename `USED` to `USED_COMPILER` to better reflect its behavior.
- Reorder some items to group the used and allocator flags together
- Renumber them without gaps
This commit is contained in:
Guillaume Gomez 2025-05-24 21:23:50 +02:00 committed by GitHub
commit 7cd749deff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 34 additions and 37 deletions

View file

@ -281,7 +281,7 @@ impl rustc_driver::Callbacks for MiriBeRustCompilerCalls {
}
let codegen_fn_attrs = tcx.codegen_fn_attrs(local_def_id);
if codegen_fn_attrs.contains_extern_indicator()
|| codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::USED)
|| codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::USED_COMPILER)
|| codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER)
{
Some((

View file

@ -135,7 +135,7 @@ pub fn iter_exported_symbols<'tcx>(
let codegen_attrs = tcx.codegen_fn_attrs(def_id);
codegen_attrs.contains_extern_indicator()
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL)
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED)
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED_COMPILER)
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER)
};
if exported {