Skip to main content

Module driver

Module driver 

Source
Expand description

Run the rustc compiler with our custom options and hooks.

Structsยง

CharonCallbacks
The callbacks for Charon
RunCompilerNormallyCallbacks
Dummy callbacks used to run the compiler normally when we shouldnโ€™t be analyzing the crate.

Staticsยง

SKIP_BORROWCK ๐Ÿ”’

Functionsยง

check_late_rustc_errors ๐Ÿ”’
Run rustc checks that normally happen close to codegen, so that we get all the post-mono errors etc.
def_id_debug ๐Ÿ”’
Custom DefId debug routine that doesnโ€™t print unstable values like ids and hashes.
precheck_rustc_errors ๐Ÿ”’
Run a couple of rustc queries that donโ€™t involve MIR (so that they donโ€™t steal it). Returns whether rustc reported errors. This lets us avoid running Charon translation on crates rustc already rejects.
run_compiler_with_callbacks ๐Ÿ”’
Helper that runs the compiler and catches its fatal errors.
run_rustc_driver
Run the rustc driver with our custom hooks. Returns None if the crate was not compiled with charon (e.g. because it was a dependency). Otherwise returns the translated crate, ready for post-processing transformations.
set_mir_options ๐Ÿ”’
Tweak options to get usable MIR even for foreign crates.
set_parallel_frontend ๐Ÿ”’
Enable rustcโ€™s parallel front-end.
set_skip_borrowck ๐Ÿ”’
setup_compiler ๐Ÿ”’
setup_miri_sysroot ๐Ÿ”’
cargo miri setup sets up a sysroot containing a standard library built with -Zalways-encode-mir.
skip_borrowck_if_set ๐Ÿ”’