Skip to main content

Module clean

Module clean 

Source
Expand description

Debugging code to test fingerprints computed for query results. For each node marked with #[rustc_clean] we will compare the fingerprint from the current and from the previous compilation session as appropriate:

  • #[rustc_clean(cfg="rev2", except="typeck")] if we are in #[cfg(rev2)], then the fingerprints associated with DepNode::typeck(X) must be DIFFERENT (X is the DefId of the current node).

  • #[rustc_clean(cfg="rev2")] same as above, except that the fingerprints must be the SAME (along with all other fingerprints).

  • #[rustc_clean(cfg="rev2", loaded_from_disk="typeck")] asserts that the query result for DepNode::typeck(X) was actually loaded from disk (not just marked green). This can be useful to ensure that a test is actually exercising the deserialization logic for a particular query result. This can be combined with except

Errors are reported if we are in the suitable configuration but the required condition is not met.

Re-exportsΒ§

use rustc_attr_ir::Attribute; πŸ”’
use rustc_attr_ir::AttributeKind; πŸ”’
use rustc_attr_ir::RustcCleanAttribute; πŸ”’
use rustc_attr_ir::find_attr; πŸ”’
use rustc_data_structures::fx::FxHashSet; πŸ”’
use rustc_data_structures::unord::UnordSet; πŸ”’
use rustc_hir::def_id::LocalDefId; πŸ”’
use rustc_hir::ImplItemKind; πŸ”’
use rustc_hir::ItemKind as HirItem; πŸ”’
use rustc_hir::Node as HirNode; πŸ”’
use rustc_hir::TraitItemKind; πŸ”’
use rustc_hir::intravisit; πŸ”’
use rustc_middle::dep_graph::DepKind; πŸ”’
use rustc_middle::dep_graph::DepNode; πŸ”’
use rustc_middle::dep_graph::dep_kind_from_label; πŸ”’
use rustc_middle::hir::nested_filter; πŸ”’
use rustc_middle::ty::TyCtxt; πŸ”’
use rustc_span::Span; πŸ”’
use rustc_span::Symbol; πŸ”’
use tracing::debug; πŸ”’
use crate::diagnostics; πŸ”’

StructsΒ§

Assertion πŸ”’
Represents the requested configuration by rustc_clean
CleanVisitor πŸ”’
FindAllAttrs πŸ”’
A visitor that collects all #[rustc_clean] attributes from the HIR. It is used to verify that we really ran checks for all annotated nodes.

ConstantsΒ§

BASE_CONST πŸ”’
For typedef, constants, and statics
BASE_FN πŸ”’
DepNodes for functions + methods
BASE_HIR πŸ”’
DepNodes for Hir, which is pretty much everything
BASE_IMPL πŸ”’
impl implementation of struct/trait
BASE_MIR πŸ”’
DepNodes for exported mir bodies, which is relevant in β€œexecutable” code, i.e., functions+methods
BASE_STRUCT πŸ”’
Struct, Enum and Union DepNodes
EXTRA_ASSOCIATED πŸ”’
Trait definition DepNodes. Extra DepNodes for functions and methods.
EXTRA_TRAIT πŸ”’
LABELS_ADT πŸ”’
Abstract data type (struct, enum, union) DepNodes.
LABELS_CONST πŸ”’
LABELS_CONST_IN_IMPL πŸ”’
Constant/Typedef in an impl
LABELS_CONST_IN_TRAIT πŸ”’
Trait-Const/Typedef DepNodes
LABELS_FN πŸ”’
Function DepNodes.
LABELS_FN_IN_IMPL πŸ”’
Method DepNodes.
LABELS_FN_IN_TRAIT πŸ”’
Trait method DepNodes.
LABELS_HIR_ONLY πŸ”’
For generic cases like inline-assembly, modules, etc.
LABELS_IMPL πŸ”’
Impl DepNodes.
LABELS_TRAIT πŸ”’
Impl DepNodes.

FunctionsΒ§

check_clean_annotations πŸ”’

Type AliasesΒ§

Labels πŸ”’