Rust compilation stage

  • prusti_driver registers callbacks and calls the Rust compiler.
  • The compiler expands all procedural macros, which includes the specifications.
  • The compiler does the type-checking.
  • The Prusti callback is called.

In this stage, the actual Rust compiler is invoked to make sure the given code is valid Rust code, both syntactically and semantically. Prusti integrates with the Rust compiler using rustc_driver. This allows running the Rust compiler with callbacks triggered when important stages of processing are completed. In Prusti, we are interested in two stages: