Expand description
Shared crate index built from a single parse pass over all source files.
All lint rules operate on this index rather than re-parsing files.
StructsΒ§
- Attributed
Trait Impl - Crate
Index - Shared parsed state for all lint rules.
- File
Data - Hand
Built π - The types a file builds
ExternalPtrs of itself (MXL121), in any item: - Impl
Method Entry - Per-method data collected during the crate-index pass for impl-method lint rules.
- Index
Error - Why
CrateIndex::buildfailed, with the source files it had found. - Inherent
Impl - An inherent
#[miniextendr]impl block, for the rules that look at a type across all its impl blocks (MXL121). - Lint
Item - ModDir π
- Where the
moddeclarations of one scope resolve, tracked as rustc does (rustc_expand::module).
EnumsΒ§
- Lint
Kind - Method
Receiver Kind - Receiver kind for an impl method, mirroring
ReceiverKindinminiextendr-macros.
ConstantsΒ§
- INTO_
SEXP_ πCALLS into_sexpcall spellings that build a fresh, unprotected SEXP.- NONAPI_
ATTRIB_ πFNS - Rβs non-API attribute-pairlist accessors.
R CMD check(R >= 4.6) reports them. - RAW_
R_ πEVAL_ FNS - R entry points that run R code, or Rβs interrupt handling, and longjmp out on an R error or a pending interrupt.
- RF_
ERROR_ πPATTERNS - Patterns that indicate direct Rf_error/Rf_errorcall calls in user code.
FunctionsΒ§
- block_
lines π - The 1-based lines of
blockβs{and}. - called_
idents π - The whole identifiers in
codethat a(follows (after optional whitespace): the names of the functions it calls or declares.DUPLICATE_ATTRIB(yieldsDUPLICATE_ATTRIB, neverATTRIB. - collect_
active_ πcargo_ features - Collect the set of active Cargo features from
CARGO_FEATURE_*env vars. Feature names are normalized:CARGO_FEATURE_FOO_BARβ"foo-bar". - collect_
doc_ πpkg_ links - Record the
pkg::topiclinks in the docs of a#[miniextendr]item and, for an impl block, of its methods. - collect_
items_ πrecursive - Recursively collect all lint-relevant information from parsed items.
- collect_
returned_ πtypes - Add to
outthe typetyhands to R as a class object: its last path segment,self_typeforSelf, throughResult,OptionandExternalPtr. Other names (i32,Vec, β¦) are added too; they match no class. - collect_
rs_ πfiles_ from_ module_ tree - Collect Rust source files by walking the module tree from the crate root,
following
mod child;declarations and respecting#[cfg(feature = "...")]gates viaCARGO_FEATURE_*environment variables. - detect_
receiver_ πkind - Detect the receiver kind from a method signature.
- discover_
mod_ πdeclarations - Walk parsed items looking for
mod child;declarations and recurse. - eval_
cfg_ πstr - Try to evaluate a single cfg string like
cfg(feature = "foo"). - extract_
feature_ πname - Extract the feature name from a string like
feature="foo". - extract_
param_ πnames - Extract named parameter names (and their 1-based line numbers) from a function signature.
- extract_
return_ πtype_ str - Stringify a
syn::ReturnTypeto a compact token string. - has_
constructor_ πattr - Returns true when the attribute list contains
#[miniextendr(constructor)]or#[miniextendr(r6(constructor))]/#[miniextendr(s3(constructor))]etc. - header_
allows π - Whether
// mxl::allow(<code>)is on an itemβs header: its linesfirst_line..=line(1-based: attributes, doc comments and the itemβs own first line) or the line above them. - is_
cfg_ πactive - Evaluate whether a set of
#[cfg(...)]attributes is active given the current features. - is_
external_ πptr_ new - Whether
pathends inExternalPtr::neworExternalPtr::new_unchecked, with or without a turbofish. - is_
suppressed π - Check if a lint code is suppressed via
// mxl::allow(MXL...)comment. - line_
has_ πallow - Check if a single line contains
// mxl::allow(...)matching the given code. - parse_
file π - path_
type_ πname - The type
pathnames: its last segment,self_typeforSelf. - scan_
ffi_ πunchecked_ calls - Scan raw source text for
sys::*_unchecked()calls. - scan_
nonapi_ πattrib_ calls - Scan raw source text for calls to, or declarations of,
ATTRIB/SET_ATTRIBand their_uncheckedforms. - scan_
raw_ πr_ eval_ calls - Scan the
FileData::miniextendr_bodiesfor calls toRf_eval,R_forceAndCall,Rf_applyClosureandR_CheckUserInterrupt, and their_uncheckedforms, through any path (sys::Rf_eval(,miniextendr_api::sys::Rf_eval(, an importedRf_eval(). - scan_
rf_ πerror_ calls - Scan raw source text for direct Rf_error/Rf_errorcall calls.
- scan_
vec_ πinto_ sexp_ calls - Scan raw source text for
into_sexp()/into_sexp_unchecked()calls that appear inside avec!or&[...]literal β the use-after-free idiom (#307, #1025). - self_
handle_ πty - The handle
tynames overSelf:"ExternalPtr"forExternalPtr<Self>,"ExternalPtrRef"/"ExternalPtrMut"for the views (ExternalPtrRef<'_, Self>), matched on the last path segment with aSelftype argument. - walk_
module_ πfile - Recursively walk a module file, following
moddeclarations.