Expand description
Detecting diagnostic items.
Diagnostic items are items that are not language-inherent, but can reasonably be expected to exist for diagnostic purposes. This allows diagnostic authors to refer to specific items directly, without having to guess module paths and crates. Examples are:
-
Traits like
Debug, that have no bearing on language semantics -
Compiler internal types like
TyandTyCtxt
Re-exportsยง
use rustc_attr_ir::diagnostic_items::DiagnosticItems;๐use rustc_attr_ir::find_attr;๐use rustc_hir::CRATE_OWNER_ID;๐use rustc_hir::OwnerId;๐use rustc_middle::query::LocalCrate;๐use rustc_middle::query::Providers;๐use rustc_middle::ty::TyCtxt;๐use rustc_span::def_id::DefId;๐use rustc_span::def_id::LOCAL_CRATE;๐use rustc_span::Symbol;๐use rustc_span::sym;๐use crate::diagnostics::DuplicateDiagnosticItemInCrate;๐
Functionsยง
- all_
diagnostic_ ๐items - Traverse and collect all the diagnostic items in all crates.
- collect_
item ๐ - diagnostic_
items ๐ - Traverse and collect the diagnostic items in the current crate
- observe_
item ๐ - provide ๐
- report_
duplicate_ ๐item