Skip to main content

Module target_checking

Module target_checking 

Source

Re-exportsยง

use std::borrow::Cow; ๐Ÿ”’
use rustc_ast::AttrStyle; ๐Ÿ”’
use rustc_ast::Safety; ๐Ÿ”’
use rustc_attr_ir::target::AssocCtxt; ๐Ÿ”’
use rustc_attr_ir::target::MethodKind; ๐Ÿ”’
use rustc_attr_ir::target::Target; ๐Ÿ”’
use rustc_attr_ir::AttrItem; ๐Ÿ”’
use rustc_attr_ir::Attribute; ๐Ÿ”’
use rustc_attr_ir::AttributeKind; ๐Ÿ”’
use rustc_errors::DiagArgValue; ๐Ÿ”’
use rustc_errors::MultiSpan; ๐Ÿ”’
use rustc_errors::StashKey; ๐Ÿ”’
use rustc_feature::Features; ๐Ÿ”’
use rustc_lint_defs::builtin::INVALID_DOC_ATTRIBUTES; ๐Ÿ”’
use rustc_lint_defs::builtin::MISPLACED_DIAGNOSTIC_ATTRIBUTES; ๐Ÿ”’
use rustc_lint_defs::builtin::UNUSED_ATTRIBUTES; ๐Ÿ”’
use rustc_lint_defs::builtin::USELESS_DEPRECATED; ๐Ÿ”’
use rustc_span::BytePos; ๐Ÿ”’
use rustc_span::FileName; ๐Ÿ”’
use rustc_span::RemapPathScopeComponents; ๐Ÿ”’
use rustc_span::Span; ๐Ÿ”’
use rustc_span::Symbol; ๐Ÿ”’
use rustc_span::sym; ๐Ÿ”’
use crate::context::AcceptContext; ๐Ÿ”’
use crate::diagnostics::InvalidAttrAtCrateLevel; ๐Ÿ”’
use crate::diagnostics::InvalidTarget; ๐Ÿ”’
use crate::diagnostics::InvalidTargetHelp; ๐Ÿ”’
use crate::diagnostics::ItemFollowingInnerAttr; ๐Ÿ”’
use crate::diagnostics::UnsupportedAttributesInWhere; ๐Ÿ”’
use crate::target_checking::Policy::Allow; ๐Ÿ”’
use crate::AttributeParser; ๐Ÿ”’
use crate::ShouldEmit; ๐Ÿ”’

Enumsยง

AllowedResult ๐Ÿ”’
AllowedTargets ๐Ÿ”’
Policy ๐Ÿ”’
This policy determines what diagnostics should be emitted based on the Target of the attribute.

Constantsยง

ALL_TARGETS ๐Ÿ”’
This is the list of all targets to which a attribute can be applied This is used for:

Functionsยง

allowed_targets_applied ๐Ÿ”’
Takes a list of allowed_targets for an attribute, and the target the attribute was applied to. Does some heuristic-based filtering to remove uninteresting targets, and formats the targets into a string
filter_targets ๐Ÿ”’