Re-exportsΒ§
use rustc_abi::FIRST_VARIANT;πuse rustc_attr_ir::find_attr;πuse rustc_data_structures::unord::UnordMap;πuse rustc_data_structures::unord::UnordSet;πuse rustc_hir as hir;πuse rustc_hir::def::DefKind;πuse rustc_lint_defs::declare_lint;πuse rustc_middle::query::Providers;πuse rustc_middle::ty;πuse rustc_middle::ty::AdtDef;πuse rustc_middle::ty::Instance;πuse rustc_middle::ty::Ty;πuse rustc_middle::ty::TyCtxt;πuse rustc_span::Span;πuse rustc_span::Symbol;πuse tracing::debug;πuse tracing::instrument;πuse tracing::instrument;πuse crate::diagnostics::BuiltinClashingExtern;πuse crate::diagnostics::BuiltinClashingExternSub;πuse crate::LintVec;πuse crate::types;π
StructsΒ§
- Clashing
Extern πDeclarations - Symbol
Name π
StaticsΒ§
- CLASHING_
EXTERN_ DECLARATIONS - The
clashing_extern_declarationslint detects when anextern fnhas been declared with the same name but different types.
FunctionsΒ§
- clashing_
extern_ πdeclarations - get_
relevant_ πspan - We want to ensure that we use spans for both decls that include where the name was defined, whether that was from the link_name attribute or not.
- lint_
vec π - name_
of_ πextern_ decl - Get the name of the symbol thatβs linked against for a given extern declaration. That is, the name specified in a #[link_name = β¦] attribute if one was specified, else, just the symbolβs name.
- provide π
- structurally_
same_ πtype - Checks whether two types are structurally the same enough that the declarations shouldnβt clash. We need this so we donβt emit a lint when two modules both declare an extern struct, with the same members (as the declarations shouldnβt clash).
- structurally_
same_ πtype_ impl