Expand description
Run the rustc compiler with our custom options and hooks.
Re-exportsΒ§
use crate::CharonFailure;πuse crate::toolchain::CHARON_SYSROOT_VAR;πuse crate::translate::translate_crate;πuse charon_lib::errors::ErrorCtx;πuse charon_lib::options;πuse charon_lib::options::CliOpts;πuse charon_lib::options::MirLevel;πuse charon_lib::options::selected_crate_var;πuse charon_lib::transform::TransformCtx;πuse charon_lib::utils::arg_value;πuse itertools::Itertools;πuse rustc_driver::Callbacks;πuse rustc_driver::Compilation;πuse rustc_interface::Config;πuse rustc_interface::interface::Compiler;πuse rustc_middle::ty::InstanceKind;πuse rustc_middle::ty::TyCtxt;πuse rustc_middle::util::Providers;πuse rustc_session::config::JobsMode;πuse rustc_session::output::OutputType;πuse rustc_session::output::OutputTypes;πuse rustc_span::ErrorGuaranteed;πuse rustc_span::Symbol;πuse rustc_structures::CrateType;πuse std::num::NonZero;πuse std::sync::atomic::AtomicBool;πuse std::sync::atomic::Ordering;πuse std::env;πuse std::env;πuse std::fmt;π
StructsΒ§
- Charon
Callbacks - The callbacks for Charon
- RunCompiler
Normally Callbacks - 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
DefIddebug 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.
- prefetch_
local_ πmir - Compute, in parallel, the MIR of the local bodies at the level the translation reads them. rustc computes them after the translation anyway.
- 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
Noneif 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 π - skip_
borrowck_ πif_ set