Expand description
The parsed_doc salsa query: parses a SourceFile into an Arc<ParsedDoc>
under salsa memoization. Downstream queries (file_index, method_returns,
semantic diagnostics) depend on this one, so each file is parsed at most
once per revision.
ParsedDoc owns a self-referential bumpalo arena and cannot safely
implement the structural Update trait — instead we wrap in a ParsedArc
newtype whose Update impl uses Arc::ptr_eq. Every reparse produces a
new Arc, so pointer equality is a correct (if conservative) “changed”
signal: salsa never falsely backdates, and downstream queries re-run after
every input text change.
Structs§
- Parsed
Arc - Opaque handle to a parsed document. Cheap to clone (refcount bump); never
compared structurally. See module docs for the
Updatecontract.
Functions§
- parse_
error_ count - Parse-error count, derived from
parsed_doc. Kept as a separate query so callers that only need the diagnostic count don’t clone the parsed AST. - parsed_
doc - Parse the file’s source text.
no_eqbecauseParsedArchas no structural equality — invalidation is driven entirely by input changes, not by comparing the new value against the old one.