do not pass TyCtxt by reference

This commit is contained in:
Ralf Jung 2022-06-02 15:11:22 -04:00
parent 7f4f6072aa
commit e79a331fea
2 changed files with 2 additions and 2 deletions

View File

@ -858,7 +858,7 @@ pub fn isolation_abort_error<'tcx>(name: &str) -> InterpResult<'tcx> {
/// Retrieve the list of local crates that should have been passed by cargo-miri in
/// MIRI_LOCAL_CRATES and turn them into `CrateNum`s.
pub fn get_local_crates(tcx: &TyCtxt<'_>) -> Vec<CrateNum> {
pub fn get_local_crates(tcx: TyCtxt<'_>) -> Vec<CrateNum> {
// Convert the local crate names from the passed-in config into CrateNums so that they can
// be looked up quickly during execution
let local_crate_names = std::env::var("MIRI_LOCAL_CRATES")

View File

@ -327,7 +327,7 @@ pub struct Evaluator<'mir, 'tcx> {
impl<'mir, 'tcx> Evaluator<'mir, 'tcx> {
pub(crate) fn new(config: &MiriConfig, layout_cx: LayoutCx<'tcx, TyCtxt<'tcx>>) -> Self {
let local_crates = helpers::get_local_crates(&layout_cx.tcx);
let local_crates = helpers::get_local_crates(layout_cx.tcx);
let layouts =
PrimitiveLayouts::new(layout_cx).expect("Couldn't get layouts of primitive types");
let profiler = config.measureme_out.as_ref().map(|out| {