AttributeKind in rustc_hir::attrs - Rust
Description: Represents parsed built-in inert attributes.

Skip to main content

## AttributeKind

# Enum AttributeKind

Source

    pub enum AttributeKind {
    Show 183 variants    AllowInternalUnsafe(Span),
        AllowInternalUnstable(ThinVec<(Symbol, Span)>, Span),
        AutomaticallyDerived,
        CfgAttrTrace,
        CfgTrace(ThinVec<(CfgEntry, Span)>),
        CfiEncoding {
            encoding: Symbol,
        },
        Cold,
        CollapseDebugInfo(CollapseMacroDebuginfo),
        CompilerBuiltins,
        ConstContinue(Span),
        Coroutine,
        Coverage(CoverageAttrKind),
        CrateName {
            name: Symbol,
            name_span: Span,
            attr_span: Span,
        },
        CrateType(ThinVec<CrateType>),
        CustomMir(Option<(MirDialect, Span)>, Option<(MirPhase, Span)>),
        DebuggerVisualizer(ThinVec<DebugVisualizer>),
        DefaultLibAllocator,
        Deprecated {
            deprecation: Deprecation,
            span: Span,
        },
        DoNotRecommend,
        Doc(Box<DocAttribute>),
        DocComment {
            style: AttrStyle,
            kind: DocFragmentKind,
            span: Span,
            comment: Symbol,
        },
        EiiDeclaration(EiiDecl),
        EiiImpls(ThinVec<EiiImpl>),
        ExportName {
            name: Symbol,
            span: Span,
        },
        ExportStable,
        Feature(ThinVec<Ident>, Span),
        FfiConst,
        FfiPure(Span),
        Fundamental,
        Ignore {
            span: Span,
            reason: Option<Symbol>,
        },
        Inline(InlineAttr, Span),
        InstructionSet(InstructionSetAttr),
        Lang(LangItem),
        Link(ThinVec<LinkEntry>, Span),
        LinkName {
            name: Symbol,
            span: Span,
        },
        LinkOrdinal {
            ordinal: u16,
            span: Span,
        },
        LinkSection {
            name: Symbol,
        },
        Linkage(Linkage, Span),
        LoopMatch(Span),
        MacroEscape,
        MacroExport {
            span: Span,
            local_inner_macros: bool,
        },
        MacroUse {
            span: Span,
            arguments: MacroUseArgs,
        },
        Marker,
        MayDangle(Span),
        MoveSizeLimit {
            limit: Limit,
        },
        MustNotSupend {
            reason: Option<Symbol>,
        },
        MustUse {
            span: Span,
            reason: Option<Symbol>,
        },
        Naked(Span),
        NeedsAllocator,
        NeedsPanicRuntime,
        NoBuiltins,
        NoCore,
        NoImplicitPrelude,
        NoLink,
        NoMain,
        NoMangle(Span),
        NoStd,
        NonExhaustive(Span),
        OnConst {
            span: Span,
            directive: Option<Box<Directive>>,
        },
        OnMove {
            directive: Option<Box<Directive>>,
        },
        OnUnimplemented {
            directive: Option<Box<Directive>>,
        },
        OnUnknown {
            directive: Option<Box<Directive>>,
        },
        OnUnmatchArgs {
            directive: Option<Box<Directive>>,
        },
        Optimize(OptimizeAttr, Span),
        PanicRuntime,
        PatchableFunctionEntry {
            prefix: u8,
            entry: u8,
        },
        Path(Symbol),
        PatternComplexityLimit {
            limit: Limit,
        },
        PinV2(Span),
        PreludeImport,
        ProcMacro,
        ProcMacroAttribute,
        ProcMacroDerive {
            trait_name: Symbol,
            helper_attrs: ThinVec<Symbol>,
        },
        ProfilerRuntime,
        RecursionLimit {
            limit: Limit,
        },
        ReexportTestHarnessMain(Symbol),
        RegisterTool(ThinVec<Ident>),
        Repr {
            reprs: ThinVec<(ReprAttr, Span)>,
            first_span: Span,
        },
        RustcAbi {
            attr_span: Span,
            kind: RustcAbiAttrKind,
        },
        RustcAlign {
            align: Align,
            span: Span,
        },
        RustcAllocator,
        RustcAllocatorZeroed,
        RustcAllocatorZeroedVariant {
            name: Symbol,
        },
        RustcAllowConstFnUnstable(ThinVec<Symbol>, Span),
        RustcAllowIncoherentImpl(Span),
        RustcAsPtr,
        RustcAutodiff(Option<Box<RustcAutodiff>>),
        RustcBodyStability {
            stability: DefaultBodyStability,
            span: Span,
        },
        RustcBuiltinMacro {
            builtin_name: Option<Symbol>,
            helper_attrs: ThinVec<Symbol>,
        },
        RustcCaptureAnalysis,
        RustcCguTestAttr(ThinVec<(Span, CguFields)>),
        RustcClean(ThinVec<RustcCleanAttribute>),
        RustcCoherenceIsCore,
        RustcCoinductive,
        RustcConfusables {
            confusables: ThinVec<Symbol>,
        },
        RustcConstStability {
            stability: PartialConstStability,
            span: Span,
        },
        RustcConstStableIndirect,
        RustcConversionSuggestion,
        RustcDeallocator,
        RustcDelayedBugFromInsideQuery,
        RustcDenyExplicitImpl,
        RustcDeprecatedSafe2024 {
            suggestion: Symbol,
        },
        RustcDiagnosticItem(Symbol),
        RustcDoNotConstCheck,
        RustcDocPrimitive(Span, Symbol),
        RustcDummy,
        RustcDumpDefParents,
        RustcDumpDefPath(Span),
        RustcDumpHiddenTypeOfOpaques,
        RustcDumpInferredOutlives,
        RustcDumpItemBounds,
        RustcDumpLayout(ThinVec<RustcDumpLayoutKind>),
        RustcDumpObjectLifetimeDefaults,
        RustcDumpPredicates,
        RustcDumpSymbolName(Span),
        RustcDumpUserArgs,
        RustcDumpVariances,
        RustcDumpVariancesOfOpaques,
        RustcDumpVtable(Span),
        RustcDynIncompatibleTrait(Span),
        RustcEffectiveVisibility,
        RustcEiiForeignItem,
        RustcEvaluateWhereClauses,
        RustcHasIncoherentInherentImpls,
        RustcIfThisChanged(Span, Option<Symbol>),
        RustcInheritOverflowChecks,
        RustcInsignificantDtor,
        RustcIntrinsic,
        RustcIntrinsicConstStableIndirect,
        RustcLegacyConstGenerics {
            fn_indexes: ThinVec<(usize, Span)>,
            attr_span: Span,
        },
        RustcLintOptDenyFieldAccess {
            lint_message: Symbol,
        },
        RustcLintOptTy,
        RustcLintQueryInstability,
        RustcLintUntrackedQueryInformation,
        RustcMacroTransparency(Transparency),
        RustcMain,
        RustcMir(ThinVec<RustcMirKind>),
        RustcMustImplementOneOf {
            attr_span: Span,
            fn_names: ThinVec<Ident>,
        },
        RustcMustMatchExhaustively(Span),
        RustcNeverReturnsNullPtr,
        RustcNeverTypeOptions {
            fallback: Option<DivergingFallbackBehavior>,
            diverging_block_default: Option<DivergingBlockBehavior>,
        },
        RustcNoImplicitAutorefs,
        RustcNoImplicitBounds,
        RustcNoMirInline,
        RustcNoWritable,
        RustcNonConstTraitMethod,
        RustcNonnullOptimizationGuaranteed,
        RustcNounwind,
        RustcObjcClass {
            classname: Symbol,
        },
        RustcObjcSelector {
            methname: Symbol,
        },
        RustcOffloadKernel,
        RustcParenSugar,
        RustcPassByValue,
        RustcPassIndirectlyInNonRusticAbis(Span),
        RustcPreserveUbChecks,
        RustcProcMacroDecls,
        RustcPubTransparent(Span),
        RustcReallocator,
        RustcRegions,
        RustcReservationImpl(Symbol),
        RustcScalableVector {
            element_count: Option<u16>,
        },
        RustcShouldNotBeCalledOnConstItems,
        RustcSimdMonomorphizeLaneLimit(Limit),
        RustcSkipDuringMethodDispatch {
            array: bool,
            boxed_slice: bool,
        },
        RustcSpecializationTrait,
        RustcStdInternalSymbol,
        RustcStrictCoherence(Span),
        RustcTestMarker(Symbol),
        RustcThenThisWouldNeed(ThinVec<Ident>),
        RustcTrivialFieldReads,
        RustcUnsafeSpecializationMarker,
        Sanitize {
            on_set: SanitizerSet,
            off_set: SanitizerSet,
            rtsan: Option<RtsanSetting>,
            span: Span,
        },
        ShouldPanic {
            reason: Option<Symbol>,
        },
        Stability {
            stability: Stability,
            span: Span,
        },
        TargetFeature {
            features: ThinVec<(Symbol, Span)>,
            attr_span: Span,
            was_forced: bool,
        },
        TestRunner(Path),
        ThreadLocal,
        TrackCaller(Span),
        TypeLengthLimit {
            limit: Limit,
        },
        UnstableFeatureBound(ThinVec<(Symbol, Span)>),
        UnstableRemoved(ThinVec<UnstableRemovedFeature>),
        Used {
            used_by: UsedBy,
        },
        WindowsSubsystem(WindowsSubsystemKind),
    }

Expand description

Represents parsed built-in inert attributes.

### §Overview

These attributes are markers that guide the compilation process and are never expanded into other code. They persist throughout the compilation phases, from AST to HIR and beyond.

### §Attribute Processing

While attributes are initially parsed by `rustc_parse` into `ast::Attribute`, they still contain raw token streams because different attributes have different internal structures. This enum represents the final, fully parsed form of these attributes, where each variant contains all the information and structure relevant for the specific attribute.

Some attributes can be applied multiple times to the same item, and they are “collapsed” into a single semantic attribute. For example:

    #[repr(C)]
    #[repr(packed)]
    struct S { }

This is equivalent to `#[repr(C, packed)]` and results in a single `AttributeKind::Repr` containing both `C` and `packed` annotations. This collapsing happens during parsing and is reflected in the data structures defined in this enum.

### §Usage

These parsed attributes are used throughout the compiler to:

- Control code generation (e.g., `#[repr]`)
- Mark API stability (`#[stable]`, `#[unstable]`)
- Provide documentation (`#[doc]`)
- Guide compiler behavior (e.g., `#[allow_internal_unstable]`)

### §Note on Attribute Organization

Some attributes like `InlineAttr`, `OptimizeAttr`, and `InstructionSetAttr` are defined separately from this enum because they are used in specific compiler phases (like code generation) and don’t need to persist throughout the entire compilation process. They are typically processed and converted into their final form earlier in the compilation pipeline.

For example:

- `InlineAttr` is used during code generation to control function inlining
- `OptimizeAttr` is used to control optimization levels
- `InstructionSetAttr` is used for target-specific code generation

These attributes are handled by their respective compiler passes in the `rustc_codegen_ssa` crate and don’t need to be preserved in the same way as the attributes in this enum.

For more details on attribute parsing, see the `rustc_attr_parsing` crate.

## Variants§

§

### AllowInternalUnsafe(Span)

Represents `#[allow_internal_unsafe]`.

§

### AllowInternalUnstable(ThinVec<(Symbol, Span)>, Span)

Represents `#[allow_internal_unstable]`.

§

### AutomaticallyDerived

Represents `#[automatically_derived]`

§

### CfgAttrTrace

Represents the trace attribute of `#[cfg_attr]`

§

### CfgTrace(ThinVec<(CfgEntry, Span)>)

Represents the trace attribute of `#[cfg]`

§

### CfiEncoding

Represents `#[cfi_encoding]`

#### Fields

§`encoding: Symbol`
§

### Cold

Represents `#[cold]`.

§

### CollapseDebugInfo(CollapseMacroDebuginfo)

Represents `#[collapse_debuginfo]`.

§

### CompilerBuiltins

Represents `#[compiler_builtins]`.

§

### ConstContinue(Span)

Represents `#[const_continue]`.

§

### Coroutine

Represents `#[coroutine]`.

§

### Coverage(CoverageAttrKind)

Represents `#[coverage(..)]`.

§

### CrateName

Represents `#[crate_name = ...]`

#### Fields

§`name: Symbol`
§`name_span: Span`
§`attr_span: Span`
§

### CrateType(ThinVec<CrateType>)

Represents `#![crate_type = ...]`

§

### CustomMir(Option<(MirDialect, Span)>, Option<(MirPhase, Span)>)

Represents `#[custom_mir]`.

§

### DebuggerVisualizer(ThinVec<DebugVisualizer>)

Represents `#[debugger_visualizer]`.

§

### DefaultLibAllocator

Represents `#![default_lib_allocator]`

§

### Deprecated

Represents `#[deprecated]`.

#### Fields

§`deprecation: Deprecation`
§`span: Span`
§

### DoNotRecommend

Represents `#[diagnostic::do_not_recommend]`.

§

### Doc(Box<DocAttribute>)

Represents `#[doc]`. Represents all other uses of the `#[doc]` attribute.

§

### DocComment

Represents specifically `#[doc = "..."]`. i.e. doc comments.

#### Fields

§`style: AttrStyle`
§`kind: DocFragmentKind`
§`span: Span`
§`comment: Symbol`
§

### EiiDeclaration(EiiDecl)

Implementation detail of `#[eii]`

§

### EiiImpls(ThinVec<EiiImpl>)

Implementation detail of `#[eii]`

§

### ExportName

Represents `#[export_name]`.

#### Fields

§`name: Symbol`

The name to export this item with. It may not contain \0 bytes as it will be converted to a null-terminated string.

§`span: Span`
§

### ExportStable

Represents `#[export_stable]`.

§

### Feature(ThinVec<Ident>, Span)

Represents `#[feature(...)]`

§

### FfiConst

Represents `#[ffi_const]`.

§

### FfiPure(Span)

Represents `#[ffi_pure]`.

§

### Fundamental

Represents `#[fundamental]`.

§

### Ignore

Represents `#[ignore]`

#### Fields

§`span: Span`
§`reason: Option<Symbol>`

ignore can optionally have a reason: `#[ignore = "reason this is ignored"]`

§

### Inline(InlineAttr, Span)

Represents `#[inline]` and `#[rustc_force_inline]`.

§

### InstructionSet(InstructionSetAttr)

Represents `#[instruction_set]`

§

### Lang(LangItem)

Represents `#[lang]`

§

### Link(ThinVec<LinkEntry>, Span)

Represents `#[link]`.

§

### LinkName

Represents `#[link_name]`.

#### Fields

§`name: Symbol`
§`span: Span`
§

### LinkOrdinal

Represents `#[link_ordinal]`.

#### Fields

§`ordinal: u16`
§`span: Span`
§

### LinkSection

Represents `#[link_section]`

#### Fields

§`name: Symbol`
§

### Linkage(Linkage, Span)

Represents `#[linkage]`.

§

### LoopMatch(Span)

Represents `#[loop_match]`.

§

### MacroEscape

Represents `#[macro_escape]`.

§

### MacroExport

Represents `#[macro_export]`.

#### Fields

§`span: Span`
§`local_inner_macros: bool`
§

### MacroUse

Represents `#[macro_use]`.

#### Fields

§`span: Span`
§`arguments: MacroUseArgs`
§

### Marker

Represents `#[marker]`.

§

### MayDangle(Span)

Represents `#[may_dangle]`.

§

### MoveSizeLimit

Represents `#[move_size_limit]`

#### Fields

§`limit: Limit`
§

### MustNotSupend

Represents `#[must_not_suspend]`

#### Fields

§`reason: Option<Symbol>`
§

### MustUse

Represents `#[must_use]`.

#### Fields

§`span: Span`

Used by `clippy`.

§`reason: Option<Symbol>`

must_use can optionally have a reason: `#[must_use = "reason this must be used"]`

§

### Naked(Span)

Represents `#[naked]`

§

### NeedsAllocator

Represents `#[needs_allocator]`

§

### NeedsPanicRuntime

Represents `#[needs_panic_runtime]`

§

### NoBuiltins

Represents `#[no_builtins]`

§

### NoCore

Represents `#[no_core]`

§

### NoImplicitPrelude

Represents `#[no_implicit_prelude]`

§

### NoLink

Represents `#[no_link]`

§

### NoMain

Represents `#[no_main]`

§

### NoMangle(Span)

Represents `#[no_mangle]`

§

### NoStd

Represents `#[no_std]`

§

### NonExhaustive(Span)

Represents `#[non_exhaustive]`

§

### OnConst

Represents `#[diagnostic::on_const]`.

#### Fields

§`span: Span`
§`directive: Option<Box<Directive>>`

None if the directive was malformed in some way.

§

### OnMove

Represents `#[diagnostic::on_move]`

#### Fields

§`directive: Option<Box<Directive>>`
§

### OnUnimplemented

Represents `#[rustc_on_unimplemented]` and `#[diagnostic::on_unimplemented]`.

#### Fields

§`directive: Option<Box<Directive>>`

None if the directive was malformed in some way.

§

### OnUnknown

Represents `#[diagnostic::on_unknown]`

#### Fields

§`directive: Option<Box<Directive>>`

None if the directive was malformed in some way.

§

### OnUnmatchArgs

Represents `#[diagnostic::on_unmatch_args]`.

#### Fields

§`directive: Option<Box<Directive>>`

None if the directive was malformed in some way.

§

### Optimize(OptimizeAttr, Span)

Represents `#[optimize(size|speed)]`

§

### PanicRuntime

Represents `#[panic_runtime]`

§

### PatchableFunctionEntry

Represents `#[patchable_function_entry]`

#### Fields

§`prefix: u8`
§`entry: u8`
§

### Path(Symbol)

Represents `#[path]`

§

### PatternComplexityLimit

Represents `#[pattern_complexity_limit]`

#### Fields

§`limit: Limit`
§

### PinV2(Span)

Represents `#[pin_v2]`

§

### PreludeImport

Represents `#[prelude_import]`

§

### ProcMacro

Represents `#[proc_macro]`

§

### ProcMacroAttribute

Represents `#[proc_macro_attribute]`

§

### ProcMacroDerive

Represents `#[proc_macro_derive]`

#### Fields

§`trait_name: Symbol`
§`helper_attrs: ThinVec<Symbol>`
§

### ProfilerRuntime

Represents `#[profiler_runtime]`

§

### RecursionLimit

Represents `#[recursion_limit]`

#### Fields

§`limit: Limit`
§

### ReexportTestHarnessMain(Symbol)

Represents `#[reexport_test_harness_main]`

§

### RegisterTool(ThinVec<Ident>)

Represents `#[register_tool]`

§

### Repr

Represents `#[repr]`.

#### Fields

§`reprs: ThinVec<(ReprAttr, Span)>`
§`first_span: Span`
§

### RustcAbi

Represents `#[rustc_abi(..)]`

#### Fields

§`attr_span: Span`
§`kind: RustcAbiAttrKind`
§

### RustcAlign

Represents `#[align(N)]`.

#### Fields

§`align: Align`
§`span: Span`
§

### RustcAllocator

Represents `#[rustc_allocator]`

§

### RustcAllocatorZeroed

Represents `#[rustc_allocator_zeroed]`

§

### RustcAllocatorZeroedVariant

Represents `#[rustc_allocator_zeroed_variant]`

#### Fields

§`name: Symbol`
§

### RustcAllowConstFnUnstable(ThinVec<Symbol>, Span)

Represents `#[rustc_allow_const_fn_unstable]`.

§

### RustcAllowIncoherentImpl(Span)

Represents `#[rustc_allow_incoherent_impl]`.

§

### RustcAsPtr

Represents `#[rustc_as_ptr]` (used by the `dangling_pointers_from_temporaries` lint).

§

### RustcAutodiff(Option<Box<RustcAutodiff>>)

Represents `#[rustc_autodiff]`.

§

### RustcBodyStability

Represents `#[rustc_default_body_unstable]`.

#### Fields

§`stability: DefaultBodyStability`
§`span: Span`

Span of the `#[rustc_default_body_unstable(...)]` attribute

§

### RustcBuiltinMacro

Represents `#[rustc_builtin_macro]`.

#### Fields

§`builtin_name: Option<Symbol>`
§`helper_attrs: ThinVec<Symbol>`
§

### RustcCaptureAnalysis

Represents `#[rustc_capture_analysis]`

§

### RustcCguTestAttr(ThinVec<(Span, CguFields)>)

Represents `#[rustc_expected_cgu_reuse]`, `#[rustc_partition_codegened]` and `#[rustc_partition_reused]`.

§

### RustcClean(ThinVec<RustcCleanAttribute>)

Represents `#[rustc_clean]`

§

### RustcCoherenceIsCore

Represents `#[rustc_coherence_is_core]`

§

### RustcCoinductive

Represents `#[rustc_coinductive]`.

§

### RustcConfusables

Represents `#[rustc_confusables]`.

#### Fields

§`confusables: ThinVec<Symbol>`
§

### RustcConstStability

Represents `#[rustc_const_stable]` and `#[rustc_const_unstable]`.

#### Fields

§`stability: PartialConstStability`
§`span: Span`

Span of the `#[rustc_const_stable(...)]` or `#[rustc_const_unstable(...)]` attribute

§

### RustcConstStableIndirect

Represents `#[rustc_const_stable_indirect]`.

§

### RustcConversionSuggestion

Represents `#[rustc_conversion_suggestion]`

§

### RustcDeallocator

Represents `#[rustc_deallocator]`

§

### RustcDelayedBugFromInsideQuery

Represents `#[rustc_delayed_bug_from_inside_query]`

§

### RustcDenyExplicitImpl

Represents `#[rustc_deny_explicit_impl]`.

§

### RustcDeprecatedSafe2024

Represents `#[rustc_deprecated_safe_2024]`

#### Fields

§`suggestion: Symbol`
§

### RustcDiagnosticItem(Symbol)

Represents `#[rustc_diagnostic_item]`

§

### RustcDoNotConstCheck

Represents `#[rustc_do_not_const_check]`

§

### RustcDocPrimitive(Span, Symbol)

Represents `#[rustc_doc_primitive = ...]`

§

### RustcDummy

Represents `#[rustc_dummy]`.

§

### RustcDumpDefParents

Represents `#[rustc_dump_def_parents]`

§

### RustcDumpDefPath(Span)

Represents `#[rustc_dump_def_path]`

§

### RustcDumpHiddenTypeOfOpaques

Represents `#[rustc_dump_hidden_type_of_opaques]`

§

### RustcDumpInferredOutlives

Represents `#[rustc_dump_inferred_outlives]`

§

### RustcDumpItemBounds

Represents `#[rustc_dump_item_bounds]`

§

### RustcDumpLayout(ThinVec<RustcDumpLayoutKind>)

Represents `#[rustc_dump_layout]`

§

### RustcDumpObjectLifetimeDefaults

Represents `#[rustc_dump_object_lifetime_defaults]`.

§

### RustcDumpPredicates

Represents `#[rustc_dump_predicates]`

§

### RustcDumpSymbolName(Span)

Represents `#[rustc_dump_symbol_name]`

§

### RustcDumpUserArgs

Represents `#[rustc_dump_user_args]`

§

### RustcDumpVariances

Represents `#[rustc_dump_variances]`

§

### RustcDumpVariancesOfOpaques

Represents `#[rustc_dump_variances_of_opaques]`

§

### RustcDumpVtable(Span)

Represents `#[rustc_dump_vtable]`

§

### RustcDynIncompatibleTrait(Span)

Represents `#[rustc_dyn_incompatible_trait]`.

§

### RustcEffectiveVisibility

Represents `#[rustc_effective_visibility]`.

§

### RustcEiiForeignItem

Implementation detail of `#[eii]`

§

### RustcEvaluateWhereClauses

Represents `#[rustc_evaluate_where_clauses]`

§

### RustcHasIncoherentInherentImpls

§

### RustcIfThisChanged(Span, Option<Symbol>)

Represents `#[rustc_if_this_changed]`

§

### RustcInheritOverflowChecks

Represents `#[rustc_inherit_overflow_checks]`

§

### RustcInsignificantDtor

Represents `#[rustc_insignificant_dtor]`

§

### RustcIntrinsic

Represents `#[rustc_intrinsic]`

§

### RustcIntrinsicConstStableIndirect

Represents `#[rustc_intrinsic_const_stable_indirect]`

§

### RustcLegacyConstGenerics

Represents `#[rustc_legacy_const_generics]`

#### Fields

§`fn_indexes: ThinVec<(usize, Span)>`
§`attr_span: Span`
§

### RustcLintOptDenyFieldAccess

Represents `#[rustc_lint_opt_deny_field_access]`

#### Fields

§`lint_message: Symbol`
§

### RustcLintOptTy

Represents `#[rustc_lint_opt_ty]`

§

### RustcLintQueryInstability

Represents `#[rustc_lint_query_instability]`

§

### RustcLintUntrackedQueryInformation

Represents `#[rustc_lint_untracked_query_information]`

§

### RustcMacroTransparency(Transparency)

Represents `#[rustc_macro_transparency]`.

§

### RustcMain

Represents `#[rustc_main]`.

§

### RustcMir(ThinVec<RustcMirKind>)

Represents `#[rustc_mir]`.

§

### RustcMustImplementOneOf

Represents `#[rustc_must_implement_one_of]`

#### Fields

§`attr_span: Span`
§`fn_names: ThinVec<Ident>`
§

### RustcMustMatchExhaustively(Span)

Represents `#[rustc_must_match_exhaustively]`

§

### RustcNeverReturnsNullPtr

Represents `#[rustc_never_returns_null_ptr]`

§

### RustcNeverTypeOptions

Represents `#[rustc_never_type_options]`.

#### Fields

§`fallback: Option<DivergingFallbackBehavior>`
§`diverging_block_default: Option<DivergingBlockBehavior>`
§

### RustcNoImplicitAutorefs

Represents `#[rustc_no_implicit_autorefs]`

§

### RustcNoImplicitBounds

Represents `#[rustc_no_implicit_bounds]`

§

### RustcNoMirInline

Represents `#[rustc_no_mir_inline]`

§

### RustcNoWritable

Represents `#[rustc_no_writable]`

§

### RustcNonConstTraitMethod

Represents `#[rustc_non_const_trait_method]`.

§

### RustcNonnullOptimizationGuaranteed

Represents `#[rustc_nonnull_optimization_guaranteed]`.

§

### RustcNounwind

Represents `#[rustc_nounwind]`

§

### RustcObjcClass

Represents `#[rustc_objc_class]`

#### Fields

§`classname: Symbol`
§

### RustcObjcSelector

Represents `#[rustc_objc_selector]`

#### Fields

§`methname: Symbol`
§

### RustcOffloadKernel

Represents `#[rustc_offload_kernel]`

§

### RustcParenSugar

Represents `#[rustc_paren_sugar]`.

§

### RustcPassByValue

Represents `#[rustc_pass_by_value]` (used by the `rustc_pass_by_value` lint).

§

### RustcPassIndirectlyInNonRusticAbis(Span)

Represents `#[rustc_pass_indirectly_in_non_rustic_abis]`

§

### RustcPreserveUbChecks

Represents `#[rustc_preserve_ub_checks]`

§

### RustcProcMacroDecls

Represents `#[rustc_proc_macro_decls]`

§

### RustcPubTransparent(Span)

Represents `#[rustc_pub_transparent]` (used by the `repr_transparent_external_private_fields` lint).

§

### RustcReallocator

Represents `#[rustc_reallocator]`

§

### RustcRegions

Represents `#[rustc_regions]`

§

### RustcReservationImpl(Symbol)

Represents `#[rustc_reservation_impl]`

§

### RustcScalableVector

Represents `#[rustc_scalable_vector(N)]`

#### Fields

§`element_count: Option<u16>`

The base multiple of lanes that are in a scalable vector, if provided. `element_count` is not provided for representing tuple types.

§

### RustcShouldNotBeCalledOnConstItems

Represents `#[rustc_should_not_be_called_on_const_items]`

§

### RustcSimdMonomorphizeLaneLimit(Limit)

Represents `#[rustc_simd_monomorphize_lane_limit = "N"]`.

§

### RustcSkipDuringMethodDispatch

Represents `#[rustc_skip_during_method_dispatch]`.

#### Fields

§`array: bool`
§`boxed_slice: bool`
§

### RustcSpecializationTrait

Represents `#[rustc_specialization_trait]`.

§

### RustcStdInternalSymbol

Represents `#[rustc_std_internal_symbol]`.

§

### RustcStrictCoherence(Span)

Represents `#[rustc_strict_coherence]`.

§

### RustcTestMarker(Symbol)

Represents `#[rustc_test_marker]`

§

### RustcThenThisWouldNeed(ThinVec<Ident>)

Represents `#[rustc_then_this_would_need]`

§

### RustcTrivialFieldReads

Represents `#[rustc_trivial_field_reads]`

§

### RustcUnsafeSpecializationMarker

Represents `#[rustc_unsafe_specialization_marker]`.

§

### Sanitize

Represents `#[sanitize]`

the on set and off set are distjoint since there’s a third option: unset. a node may not set the sanitizer setting in which case it inherits from parents. rtsan is unset if None

#### Fields

§`on_set: SanitizerSet`
§`off_set: SanitizerSet`
§`rtsan: Option<RtsanSetting>`
§`span: Span`
§

### ShouldPanic

Represents `#[should_panic]`

#### Fields

§`reason: Option<Symbol>`
§

### Stability

Represents `#[stable]`, `#[unstable]` and `#[rustc_allowed_through_unstable_modules]`.

#### Fields

§`stability: Stability`
§`span: Span`

Span of the attribute.

§

### TargetFeature

Represents `#[target_feature(enable = "...")]` and `#[unsafe(force_target_feature(enable = "...")]`.

#### Fields

§`features: ThinVec<(Symbol, Span)>`
§`attr_span: Span`
§`was_forced: bool`
§

### TestRunner(Path)

Represents `#![test_runner(path)]`

§

### ThreadLocal

Represents `#[thread_local]`

§

### TrackCaller(Span)

Represents `#[track_caller]`

§

### TypeLengthLimit

Represents `#[type_length_limit]`

#### Fields

§`limit: Limit`
§

### UnstableFeatureBound(ThinVec<(Symbol, Span)>)

Represents `#[unstable_feature_bound]`.

§

### UnstableRemoved(ThinVec<UnstableRemovedFeature>)

Represents all `#![unstable_removed(...)]` features

§

### Used

Represents `#[used]`

#### Fields

§`used_by: UsedBy`
§

### WindowsSubsystem(WindowsSubsystemKind)

Represents `#[windows_subsystem]`.

## Implementations§

Source§

### impl AttributeKind

Source

#### pub fn encode_cross_crate(&self) -> EncodeCrossCrate

Whether this attribute should be encoded in metadata files.

If this is “Yes”, then another crate can do `tcx.get_all_attrs(did)` for a did in this crate, and get the attribute. When this is No, the attribute is filtered out while encoding and other crate won’t be able to observe it. This can be unexpectedly good for performance, so unless necessary for cross-crate compilation, prefer No.

## Trait Implementations§

Source§

### impl Clone for AttributeKind

Source§

#### fn clone(&self) -> AttributeKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

#### fn clone_from(&mut self, source: &Self)

Performs copy-assignment from `source`. Read more
Source§

### impl Debug for AttributeKind

Source§

#### fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

### impl<__D: SpanDecoder> Decodable<__D> for AttributeKind

Source§

#### fn decode(__decoder: &mut __D) -> Self

Source§

### impl<__E: SpanEncoder> Encodable<__E> for AttributeKind

Source§

#### fn encode(&self, __encoder: &mut __E)

Source§

### impl PrintAttribute for AttributeKind

Source§

#### fn should_render(&self) -> bool

Whether or not this will render as something meaningful, or if it’s skipped (which will force the containing struct to also skip printing a comma and the field name).
Source§

#### fn print_attribute(&self, __p: &mut Printer)

Source§

### impl StableHash for AttributeKind

Source§

#### fn stable_hash<__Hcx: StableHashCtxt>( &self, __hcx: &mut __Hcx, __hasher: &mut StableHasher, )

## Auto Trait Implementations§

§

### impl DynSend for AttributeKind

§

### impl DynSync for AttributeKind

§

### impl Freeze for AttributeKind

§

### impl RefUnwindSafe for AttributeKind

§

### impl Send for AttributeKind

§

### impl Sync for AttributeKind

§

### impl Unpin for AttributeKind

§

### impl UnsafeUnpin for AttributeKind

§

### impl UnwindSafe for AttributeKind

## Blanket Implementations§

Source§

### impl<T> Aligned for T

Source§

#### const ALIGN: Alignment

Alignment of `Self`.
Source§

### impl<T> Any for T
where T: 'static + ?Sized,

Source§

#### fn type_id(&self) -> TypeId

Gets the `TypeId` of `self`. Read more
Source§

### impl<T> Borrow<T> for T
where T: ?Sized,

Source§

#### fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

### impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

#### fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

### impl<T> CloneToUninit for T
where T: Clone,

Source§

#### unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (`clone_to_uninit`)
Performs copy-assignment from `self` to `dest`. Read more
Source§

### impl<T> DynClone for T
where T: Clone,

Source§

#### fn __clone_box(&self, _: Private) -> *mut ()

Source§

### impl<T> From<T> for T

Source§

#### fn from(t: T) -> T

Returns the argument unchanged.

Source§

### impl<T> Instrument for T

Source§

#### fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided `Span`, returning an `Instrumented` wrapper. Read more
Source§

#### fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current `Span`, returning an `Instrumented` wrapper. Read more
Source§

### impl<T, U> Into<U> for T
where U: From<T>,

Source§

#### fn into(self) -> U

Calls `U::from(self)`.

That is, this conversion is whatever the implementation of `From<T> for U` chooses to do.

Source§

### impl<T> IntoEither for T

Source§

#### fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts `self` into a `Left` variant of `Either<Self, Self>` if `into_left` is `true`. Converts `self` into a `Right` variant of `Either<Self, Self>` otherwise. Read more
Source§

#### fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts `self` into a `Left` variant of `Either<Self, Self>` if `into_left(&self)` returns `true`. Converts `self` into a `Right` variant of `Either<Self, Self>` otherwise. Read more
Source§

### impl<T> Pointable for T

Source§

#### const ALIGN: usize

The alignment of pointer.
Source§

#### type Init = T

The type for initializers.
Source§

#### unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

#### unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

#### unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

#### unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

### impl<T> Same for T

Source§

#### type Output = T

Should always be `Self`
Source§

### impl<T> ToOwned for T
where T: Clone,

Source§

#### type Owned = T

The resulting type after obtaining ownership.
Source§

#### fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

#### fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

### impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

#### type Error = Infallible

The type returned in the event of a conversion error.
Source§

#### fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

### impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

#### type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

#### fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

### impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

#### fn vzip(self) -> V

Source§

### impl<T> WithSubscriber for T

Source§

#### fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided `Subscriber` to this type, returning a `WithDispatch` wrapper. Read more
Source§

#### fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default `Subscriber` to this type, returning a `WithDispatch` wrapper. Read more
Source§

### impl<T> ErasedDestructor for T
where T: 'static,

## Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain `repr(...)` attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 40 bytes

Size for each variant:

- `AllowInternalUnsafe`: 11 bytes
- `AllowInternalUnstable`: 23 bytes
- `AutomaticallyDerived`: 0 bytes
- `CfgAttrTrace`: 0 bytes
- `CfgTrace`: 15 bytes
- `CfiEncoding`: 7 bytes
- `Cold`: 0 bytes
- `CollapseDebugInfo`: 1 byte
- `CompilerBuiltins`: 0 bytes
- `ConstContinue`: 11 bytes
- `Coroutine`: 0 bytes
- `Coverage`: 1 byte
- `CrateName`: 23 bytes
- `CrateType`: 15 bytes
- `CustomMir`: 27 bytes
- `DebuggerVisualizer`: 15 bytes
- `DefaultLibAllocator`: 0 bytes
- `Deprecated`: 35 bytes
- `DoNotRecommend`: 0 bytes
- `Doc`: 15 bytes
- `DocComment`: 27 bytes
- `EiiDeclaration`: 27 bytes
- `EiiImpls`: 15 bytes
- `ExportName`: 15 bytes
- `ExportStable`: 0 bytes
- `Feature`: 23 bytes
- `FfiConst`: 0 bytes
- `FfiPure`: 11 bytes
- `Fundamental`: 0 bytes
- `Ignore`: 15 bytes
- `Inline`: 23 bytes
- `InstructionSet`: 1 byte
- `Lang`: 1 byte
- `Link`: 23 bytes
- `LinkName`: 15 bytes
- `LinkOrdinal`: 11 bytes
- `LinkSection`: 7 bytes
- `Linkage`: 11 bytes
- `LoopMatch`: 11 bytes
- `MacroEscape`: 0 bytes
- `MacroExport`: 11 bytes
- `MacroUse`: 23 bytes
- `Marker`: 0 bytes
- `MayDangle`: 11 bytes
- `MoveSizeLimit`: 15 bytes
- `MustNotSupend`: 7 bytes
- `MustUse`: 15 bytes
- `Naked`: 11 bytes
- `NeedsAllocator`: 0 bytes
- `NeedsPanicRuntime`: 0 bytes
- `NoBuiltins`: 0 bytes
- `NoCore`: 0 bytes
- `NoImplicitPrelude`: 0 bytes
- `NoLink`: 0 bytes
- `NoMain`: 0 bytes
- `NoMangle`: 11 bytes
- `NoStd`: 0 bytes
- `NonExhaustive`: 11 bytes
- `OnConst`: 23 bytes
- `OnMove`: 15 bytes
- `OnUnimplemented`: 15 bytes
- `OnUnknown`: 15 bytes
- `OnUnmatchArgs`: 15 bytes
- `Optimize`: 11 bytes
- `PanicRuntime`: 0 bytes
- `PatchableFunctionEntry`: 2 bytes
- `Path`: 7 bytes
- `PatternComplexityLimit`: 15 bytes
- `PinV2`: 11 bytes
- `PreludeImport`: 0 bytes
- `ProcMacro`: 0 bytes
- `ProcMacroAttribute`: 0 bytes
- `ProcMacroDerive`: 15 bytes
- `ProfilerRuntime`: 0 bytes
- `RecursionLimit`: 15 bytes
- `ReexportTestHarnessMain`: 7 bytes
- `RegisterTool`: 15 bytes
- `Repr`: 23 bytes
- `RustcAbi`: 11 bytes
- `RustcAlign`: 11 bytes
- `RustcAllocator`: 0 bytes
- `RustcAllocatorZeroed`: 0 bytes
- `RustcAllocatorZeroedVariant`: 7 bytes
- `RustcAllowConstFnUnstable`: 23 bytes
- `RustcAllowIncoherentImpl`: 11 bytes
- `RustcAsPtr`: 0 bytes
- `RustcAutodiff`: 15 bytes
- `RustcBodyStability`: 31 bytes
- `RustcBuiltinMacro`: 15 bytes
- `RustcCaptureAnalysis`: 0 bytes
- `RustcCguTestAttr`: 15 bytes
- `RustcClean`: 15 bytes
- `RustcCoherenceIsCore`: 0 bytes
- `RustcCoinductive`: 0 bytes
- `RustcConfusables`: 15 bytes
- `RustcConstStability`: 35 bytes
- `RustcConstStableIndirect`: 0 bytes
- `RustcConversionSuggestion`: 0 bytes
- `RustcDeallocator`: 0 bytes
- `RustcDelayedBugFromInsideQuery`: 0 bytes
- `RustcDenyExplicitImpl`: 0 bytes
- `RustcDeprecatedSafe2024`: 7 bytes
- `RustcDiagnosticItem`: 7 bytes
- `RustcDoNotConstCheck`: 0 bytes
- `RustcDocPrimitive`: 15 bytes
- `RustcDummy`: 0 bytes
- `RustcDumpDefParents`: 0 bytes
- `RustcDumpDefPath`: 11 bytes
- `RustcDumpHiddenTypeOfOpaques`: 0 bytes
- `RustcDumpInferredOutlives`: 0 bytes
- `RustcDumpItemBounds`: 0 bytes
- `RustcDumpLayout`: 15 bytes
- `RustcDumpObjectLifetimeDefaults`: 0 bytes
- `RustcDumpPredicates`: 0 bytes
- `RustcDumpSymbolName`: 11 bytes
- `RustcDumpUserArgs`: 0 bytes
- `RustcDumpVariances`: 0 bytes
- `RustcDumpVariancesOfOpaques`: 0 bytes
- `RustcDumpVtable`: 11 bytes
- `RustcDynIncompatibleTrait`: 11 bytes
- `RustcEffectiveVisibility`: 0 bytes
- `RustcEiiForeignItem`: 0 bytes
- `RustcEvaluateWhereClauses`: 0 bytes
- `RustcHasIncoherentInherentImpls`: 0 bytes
- `RustcIfThisChanged`: 15 bytes
- `RustcInheritOverflowChecks`: 0 bytes
- `RustcInsignificantDtor`: 0 bytes
- `RustcIntrinsic`: 0 bytes
- `RustcIntrinsicConstStableIndirect`: 0 bytes
- `RustcLegacyConstGenerics`: 23 bytes
- `RustcLintOptDenyFieldAccess`: 7 bytes
- `RustcLintOptTy`: 0 bytes
- `RustcLintQueryInstability`: 0 bytes
- `RustcLintUntrackedQueryInformation`: 0 bytes
- `RustcMacroTransparency`: 1 byte
- `RustcMain`: 0 bytes
- `RustcMir`: 15 bytes
- `RustcMustImplementOneOf`: 23 bytes
- `RustcMustMatchExhaustively`: 11 bytes
- `RustcNeverReturnsNullPtr`: 0 bytes
- `RustcNeverTypeOptions`: 2 bytes
- `RustcNoImplicitAutorefs`: 0 bytes
- `RustcNoImplicitBounds`: 0 bytes
- `RustcNoMirInline`: 0 bytes
- `RustcNoWritable`: 0 bytes
- `RustcNonConstTraitMethod`: 0 bytes
- `RustcNonnullOptimizationGuaranteed`: 0 bytes
- `RustcNounwind`: 0 bytes
- `RustcObjcClass`: 7 bytes
- `RustcObjcSelector`: 7 bytes
- `RustcOffloadKernel`: 0 bytes
- `RustcParenSugar`: 0 bytes
- `RustcPassByValue`: 0 bytes
- `RustcPassIndirectlyInNonRusticAbis`: 11 bytes
- `RustcPreserveUbChecks`: 0 bytes
- `RustcProcMacroDecls`: 0 bytes
- `RustcPubTransparent`: 11 bytes
- `RustcReallocator`: 0 bytes
- `RustcRegions`: 0 bytes
- `RustcReservationImpl`: 7 bytes
- `RustcScalableVector`: 5 bytes
- `RustcShouldNotBeCalledOnConstItems`: 0 bytes
- `RustcSimdMonomorphizeLaneLimit`: 15 bytes
- `RustcSkipDuringMethodDispatch`: 2 bytes
- `RustcSpecializationTrait`: 0 bytes
- `RustcStdInternalSymbol`: 0 bytes
- `RustcStrictCoherence`: 11 bytes
- `RustcTestMarker`: 7 bytes
- `RustcThenThisWouldNeed`: 15 bytes
- `RustcTrivialFieldReads`: 0 bytes
- `RustcUnsafeSpecializationMarker`: 0 bytes
- `Sanitize`: 15 bytes
- `ShouldPanic`: 7 bytes
- `Stability`: 31 bytes
- `TargetFeature`: 23 bytes
- `TestRunner`: 31 bytes
- `ThreadLocal`: 0 bytes
- `TrackCaller`: 11 bytes
- `TypeLengthLimit`: 15 bytes
- `UnstableFeatureBound`: 15 bytes
- `UnstableRemoved`: 15 bytes
- `Used`: 1 byte
- `WindowsSubsystem`: 1 byte