Skip to main content Module codegen_attrs Copy item path Source use rustc_abi::Align ; π use rustc_abi::ExternAbi ; π use rustc_attr_ir::Attribute ; π use rustc_attr_ir::AttributeKind ; π use rustc_attr_ir::EiiImplResolution ; π use rustc_attr_ir::InlineAttr ; π use rustc_attr_ir::Linkage ; π use rustc_attr_ir::OptimizeAttr ; π use rustc_attr_ir::RtsanSetting ; π use rustc_attr_ir::UsedBy ; π use rustc_attr_ir::find_attr ; π use rustc_hir as hir; π use rustc_hir::def::DefKind ; π use rustc_hir::def_id::DefId ; π use rustc_hir::def_id::LOCAL_CRATE ; π use rustc_hir::def_id::LocalDefId ; π use rustc_lint_defs::builtin::INLINE_NO_SANITIZE ; π use rustc_lint_defs::builtin::RTSAN_NONBLOCKING_ASYNC ; π use rustc_macros::Diagnostic ; π use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags ; π use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs ; π use rustc_middle::middle::codegen_fn_attrs::PatchableFunctionEntry ; π use rustc_middle::middle::codegen_fn_attrs::SanitizerFnAttrs ; π use rustc_middle::mono::Visibility ; π use rustc_middle::query::Providers ; π use rustc_middle::ty ; π use rustc_middle::ty::TyCtxt ; π use rustc_span::Span ; π use rustc_span::bug ; π use rustc_target::spec::Os ; π use crate::diagnostics ; π use crate::target_features::check_target_feature_trait_unsafe ; π use crate::target_features::check_tied_features ; π use crate::target_features::from_target_feature_attr ; π AsyncBlocking π InterestingAttributeDiagnosticSpans π Spans that are collected when processing built-in attributes,
that are useful for emitting diagnostics later. SanitizeOnInline π apply_overrides π Applies overrides for codegen fn attrs. These often have a specific reason why theyβre necessary.
Please comment why when adding a new one! check_result π codegen_fn_attrs π Generate the CodegenFnAttrs for an item (identified by the LocalDefId ). constructs_desugared_body_coroutine π Whether did is an async fn, gen fn, async gen fn, or async closure, i.e. its body
does nothing but construct a desugared body coroutine . handle_lang_items π inherited_align π If the provided DefId is a method in a trait impl, return the value of the #[align]
attribute on the method prototype (if any). is_desugared_body_coroutine π Whether did is the coroutine holding the body of an async fn, gen fn, async gen fn, or
async closure, as opposed to one written as an async {} block. process_builtin_attrs π Process the builtin attrs (rustc_attr_ir::Attribute ) on the item.
Many of them directly translate to codegen attrs. provide π sanitizer_settings_for π should_inherit_track_caller π Checks if the provided DefId is a method in a trait impl for a trait which has track_caller
applied to the method prototype. try_fn_sig π In some cases, attributes are only valid on functions, but itβs the check_attr
pass that checks that they arenβt used anywhere else, rather than this module.
In these cases, we bail from performing further checks that are only meaningful for
functions (such as calling fn_sig, which ICEs if given a non-function). We also
report a delayed bug, just in case check_attr isnβt doing its job.