struct CheckAttrVisitor<'tcx> {
    tcx: TyCtxt<'tcx>,
}

Fields

tcx: TyCtxt<'tcx>

Implementations

Checks any attribute.

Checks if an #[inline] is applied to a function or a closure. Returns true if valid.

Checks if a #[no_coverage] is applied directly to a function

Checks if #[naked] is applied to a function definition.

source

fn check_cmse_nonsecure_entry(
    &self,
    attr: &Attribute,
    span: Span,
    target: Target
) -> bool

Checks if #[cmse_nonsecure_entry] is applied to a function definition.

Debugging aid for object_lifetime_default query.

Checks if #[collapse_debuginfo] is applied to a macro.

Checks if a #[track_caller] is applied to a non-naked function. Returns true if valid.

Checks if the #[non_exhaustive] attribute on an item is valid. Returns true if valid.

Checks if the #[marker] attribute on an item is valid. Returns true if valid.

Checks if the #[rustc_must_implement_one_of] attribute on a target is valid. Returns true if valid.

Checks if the #[target_feature] attribute on item is valid. Returns true if valid.

Checks if the #[thread_local] attribute on item is valid. Returns true if valid.

Checks #[doc(inline)]/#[doc(no_inline)] attributes. Returns true if valid.

A doc inlining attribute is invalid if it is applied to a non-use item, or if there are conflicting attributes for one item.

specified_inline is used to keep track of whether we have already seen an inlining attribute for this item. If so, specified_inline holds the value and the span of the first inline/no_inline attribute.

Checks that an attribute is not used at the crate level. Returns true if valid.

Checks that an attribute is used at the crate level. Returns true if valid.

Checks that doc(test(...)) attribute contains only valid attributes. Returns true if valid.

Runs various checks on #[doc] attributes. Returns true if valid.

specified_inline should be initialized to None and kept for the scope of one item. Read the documentation of check_doc_inline for more information.

Warns against some misuses of #[pass_by_value]

Warns against some misuses of #[must_use]

Checks if #[must_not_suspend] is applied to a function. Returns true if valid.

Checks if #[cold] is applied to a non-function. Returns true if valid.

Checks if #[link] is applied to an item other than a foreign module.

Checks if #[link_name] is applied to an item other than a foreign function or static.

Checks if #[no_link] is applied to an extern crate. Returns true if valid.

Checks if #[export_name] is applied to a function or static. Returns true if valid.

Checks if #[rustc_legacy_const_generics] is applied to a function and has a valid argument.

Helper function for checking that the provided attribute is only applied to a function or method.

Checks that the #[rustc_lint_query_instability] attribute is only applied to a function or method.

Checks that the #[rustc_lint_diagnostics] attribute is only applied to a function or method.

Checks that the #[rustc_lint_opt_ty] attribute is only applied to a struct.

Checks that the #[rustc_lint_opt_deny_field_access] attribute is only applied to a field.

Checks that the dep-graph debugging attributes are only present when the query-dep-graph option is passed to the compiler.

Checks if #[link_section] is applied to a function or static.

Checks if #[no_mangle] is applied to a function or static.

Checks if the #[repr] attributes on item are valid.

Outputs an error for #[allow_internal_unstable] which can only be applied to macros. (Allows proc_macro functions)

Checks if the items on the #[debugger_visualizer] attribute are valid.

Outputs an error for #[allow_internal_unstable] which can only be applied to macros. (Allows proc_macro functions)

#[const_trait] only applies to traits.

Trait Implementations

Override this type to control which nested HIR are visited; see NestedFilter for details. If you override this type, you must also override nested_visit_map. Read more
If type NestedFilter is set to visit nested items, this method must also be overridden to provide a map to retrieve nested items. Read more
Visits the top-level item and (optionally) nested items / impl items. See visit_nested_item for details. Read more
Invoked when a nested item is encountered. By default, when Self::NestedFilter is nested_filter::None, this method does nothing. You probably don’t want to override this method – instead, override Self::NestedFilter or use the “shallow” or “deep” visit patterns described on itemlikevisit::ItemLikeVisitor. The only reason to override this method is if you want a nested pattern but cannot supply a Map; see nested_visit_map for advice. Read more
Like visit_nested_item(), but for trait items. See visit_nested_item() for advice on when to override this method. Read more
Like visit_nested_item(), but for impl items. See visit_nested_item() for advice on when to override this method. Read more
Like visit_nested_item(), but for foreign items. See visit_nested_item() for advice on when to override this method. Read more
Invoked to visit the body of a function, method or closure. Like visit_nested_item, does nothing by default unless you override Self::NestedFilter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

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: 8 bytes