Expand description
Effect summaries from MIR, and the checks of #[psync::graph] rewrites.
Re-exportsΒ§
use psync_check::Access;πuse psync_check::CallFact;πuse psync_check::CrateFindings;πuse psync_check::CrateSummaries;πuse psync_check::Domain;πuse psync_check::Effect;πuse psync_check::Finding;πuse psync_check::FnSummary;πuse psync_check::Resolved;πuse psync_check::Severity;πuse psync_check::conflict;πuse psync_check::env;πuse rustc_hir::def::DefKind;πuse rustc_hir::def_id::DefId;πuse rustc_hir::def_id::LOCAL_CRATE;πuse rustc_hir::def_id::LocalDefId;πuse rustc_middle::mir;πuse rustc_middle::mir::AggregateKind;πuse rustc_middle::mir::Operand;πuse rustc_middle::mir::Rvalue;πuse rustc_middle::mir::StatementKind;πuse rustc_middle::mir::TerminatorKind;πuse rustc_middle::ty;πuse rustc_middle::ty::GenericArgs;πuse rustc_middle::ty::Instance;πuse rustc_middle::ty::InstanceKind;πuse rustc_middle::ty::Ty;πuse rustc_middle::ty::TyCtxt;πuse rustc_middle::ty::TypingEnv;πuse rustc_span::Span;πuse std::collections::BTreeMap;πuse std::collections::HashMap;πuse std::collections::HashSet;πuse std::path::PathBuf;πuse std::rc::Rc;π
StructsΒ§
- Analyzer
- Chain π
- One chain of a concurrent level, as the macro tagged it.
- Checker
- Edge
- A call from one body to a local body: a function, or a closure or coroutine it creates.
- Held π
- What the values of one body hold, as
Srcs. - Local
- One bodyβs own effects (everything but its calls of local bodies), and those calls.
- Located
- An effect inside one body, with the span of the call in that body that leads to it.
- Prefix π
- A prefetched loop prefix, as the macro tagged it.
- Summary
- Tarjan π
- The state of Tarjanβs algorithm.
EnumsΒ§
- Root π
- Where a value lives in a body: a local, or, in a closure or coroutine, one of its captured
values (upvar
k) or a slot of a suspended coroutineβs state (variant, field), where locals live across anawait. - Src
- What a call passes as one argument, followed back through the callerβs body.
ConstantsΒ§
- IO_
CRATES π - Async runtimes and file helpers whose I/O is recognized by path, like stdβs.
- OPAQUE_
STD π - Crates whose functions are never followed: their I/O is recognized by path instead.
- SAME_
VALUE π - Standard-library conversions that keep the path or string they are given
(
<PathBuf as Deref>::deref,AsRef::<Path>::as_ref,Path::to_path_buf).
FunctionsΒ§
- at_call π
effectas seen by a caller that passessrcs: an effect on parameterjbecomes one on what the call passes there.- awaiting_
macro π - The outermost
select!-like macro (the names ofAWAITING_MACROSin psync-graphβs classify.rs) whose expansion wrotespan, with the span of its call. - coroutine_
of π - direct_
fs π - A file effect made by a call into a
fsmodule from the chain itself (fs::write(dst, ..),tokio::fs::read(src)): what the macro saw in the tokens and compares at run time for a gate. An effect reached through another function (a helper writing some other file) is not. - display_
path π - A definitionβs path for people:
loadrather thanload::{closure#0}. - gated_
by_ πof - The body of an
asyncblock or async closure passed to a marker. TheONof everypsync::__private::gated_by::<ON>()call in a chainβs body. - interior_
kind π Some("RefCell")whenty, behind references and shared pointers, is a cell, lock or atomic.- io_
effect π - File, socket, process, environment and output operations of std and the async runtimes,
recognized by path:
(domain, access, whether the first argument is the target). - io_
trait_ πeffect - Methods of the I/O traits (
AsyncWrite/AsyncWriteExt,io::Write,AsyncRead,io::Read) on a writer or reader that is not an in-memory buffer: a write or read of that object, named by its type. Files are classified byio_effect. - is_
plumbing π - Glue that is neither I/O nor an API call: conversions, builders, iterators, formatting.
- is_
registry π - Whether
def_idis defined in a crate from crates.io or a git dependency, rather than in the userβs workspace or a path dependency. - markers π
- What the macro made concurrent in one body, read back from its markers: each joinβs chains
(
maybe_done_at,job_at), by level, and each prefetched loop prefix (over_at). - panicking π
- Calls that panic on purpose:
panic!,assert!,unreachable!,todo!,unwrap,expect. - returns_
future π - Whether calling
def_idreturns a future: anasync fn, or a function or method returningimpl Future,Pin<Box<dyn Future>>or a named future type. Like the macro, the driver reads verbs only on awaited calls:HashMap::insertandSerializer::append_pairare not I/O. - seq_fix π
- Insert
#[psync::seq]before the statement containingspan(or, for a loop prefix, before theforloop around it), on its own line with the statementβs indentation. - site_
key π /abs/path/file.rs:line:columnof a spanβs start (column counted in characters, from 1), the key the macro computes from its tokensβ spans.- two_
path_ πfs - File operations on two paths, which write the second: the access to the first.
- user_
span π - The span of the first call in
def_idβs body (or the closures and coroutines it creates) written by the user rather than generated by the macro, to point at a chainβs own statements.
Type AliasesΒ§
- Labels π
- The label of each value a switch compares against (
None: itsotherwiseedge).