~/talk

Parsing Rust code considered harmful

Talkat EuroRust 2022 · 2022-10-13..10-14· [rust]
slides:none on file

Claim: naive parsing of Rust source fails for imports, macros and dependencies so multiple approaches are evaluated and one is chosen. Experiments use syn + cargo expand which is simple but lacks resolution, try embedding rustc as a library (callbacks, TyCtxt, MIR) which yields complete info but is brittle and high maintenance, and settle on rustdoc JSON -> cargo-breaking which extracts stable public-API data, is CI-friendly, and suggests a rust-analyzer plugin for near‑instant checks.

AI-written summary · about

  1. 0:00Introduction
  2. 1:50Static analysis in Rust
  3. 3:16cargo-breaking for breaking changes
  4. 7:10Challenges parsing Rust directly
  5. 12:27Why parsing Rust is harmful
  6. 13:10rustc as static analysis library
  7. 17:36rustc query engine limits
  8. 20:06Extracting crate data with rustdoc
  9. 23:37Comparing static analysis approaches
  10. 23:57Embedding analysis in Rust Analyzer
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.