Skip to main content

Module analysis

Module analysis 

Source
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 an await.
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 πŸ”’
effect as seen by a caller that passes srcs: an effect on parameter j becomes one on what the call passes there.
awaiting_macro πŸ”’
The outermost select!-like macro (the names of AWAITING_MACROS in psync-graph’s classify.rs) whose expansion wrote span, with the span of its call.
coroutine_of πŸ”’
direct_fs πŸ”’
A file effect made by a call into a fs module 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: load rather than load::{closure#0}.
gated_by_of πŸ”’
The body of an async block or async closure passed to a marker. The ON of every psync::__private::gated_by::<ON>() call in a chain’s body.
interior_kind πŸ”’
Some("RefCell") when ty, 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 by io_effect.
is_plumbing πŸ”’
Glue that is neither I/O nor an API call: conversions, builders, iterators, formatting.
is_registry πŸ”’
Whether def_id is 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_id returns a future: an async fn, or a function or method returning impl Future, Pin<Box<dyn Future>> or a named future type. Like the macro, the driver reads verbs only on awaited calls: HashMap::insert and Serializer::append_pair are not I/O.
seq_fix πŸ”’
Insert #[psync::seq] before the statement containing span (or, for a loop prefix, before the for loop around it), on its own line with the statement’s indentation.
site_key πŸ”’
/abs/path/file.rs:line:column of 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: its otherwise edge).