~/talk

Rust metaprogramming - macro_rules! beyond basics

Talkat Rustikon 2026 · 2026-03-19..03-20· [rust, compilers-and-language-design]
links:none on file
slides:none on file

Shows concrete macro techniques: explains hygiene rules that prevent local-name collisions but let items leak, demonstrates debugging with log_syntax, trace_macros, -Z macro-stats and cargo expand while noting cargo expand misrepresents hygiene, gives actionable tips — better error messages via typed const checks, runtime-like validation via const panics, using module-level macro_use and the paste crate to concatenate idents, and demos a working derive macro that generates getters/setters and compiles with cargo expand output.

AI-written summary · about

  1. 0:00Introduction
  2. 1:05Declarative macros recap
  3. 6:05Macro hygiene
  4. 9:40Debugging macros
  5. 16:42Writing better macros
  6. 26:12Future macro features
  7. 30:03Enterprise bean macro demo
  8. 39:00Q&A
~/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.