Expand description
Token-level read/write analysis.
Without type information, the analysis approximates what a statement touches from its tokens:
every identifier it mentions, and every access path (x, self.groups, conn.inner) it
reads or writes. A path is written by assignment, &mut path, a mutating method call on a
mut binding or &mut handle, or an order-sensitive call (send, write, recv, โฆ) on any
receiver. Two statements conflict when one writes a path that overlaps a path the other touches.
Structsยง
- Access ๐
- What one statement touches.
Constantsยง
- KEYWORDS ๐
- Keywords and names that never denote a variable.
- ORDERED_
METHODS ๐ - Calls whose relative order is observable even through
&self: channel, stream and I/O operations on one receiver must stay in program order. - PURE_
METHODS ๐ - Methods assumed not to mutate their receiver.
- READ_
PREFIXES ๐ - Prefixes of further read-only method names (
is_*,get*,as_*, โฆ).
Functionsยง
- conflict ๐
- The first path in
writesthat overlaps a path inother. - format_
captures ๐ - Names captured by
{name}/{name:spec}in a string literal (format-string arguments). - is_
punct ๐ - mentions ๐
- Identifiers mentioned by
tokens, ignoring mutability. - overlaps ๐
- True when two access paths overlap: equal, or one is a field prefix of the other.
- reads_
only ๐ - True when
methodis assumed not to mutate its receiver. - root ๐
- The identifier a dotted path starts from.
- scan ๐
- Record what
tokenstouch intoacc.
Type Aliasesยง
- Set ๐
- A set of identifier names or dotted access paths.