Skip to main content

Module codegen_attrs

Module codegen_attrs 

Source

Re-exportsΒ§

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; πŸ”’

StructsΒ§

AsyncBlocking πŸ”’
InterestingAttributeDiagnosticSpans πŸ”’
Spans that are collected when processing built-in attributes, that are useful for emitting diagnostics later.
SanitizeOnInline πŸ”’

FunctionsΒ§

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.