Skip to content

Commit

Permalink
fix for GlobalCtxt changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Nov 30, 2019
1 parent 392d745 commit a971b8a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions benches/helpers/miri_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extern crate test;

use self::miri::eval_main;
use rustc::hir::def_id::LOCAL_CRATE;
use rustc_interface::interface;
use rustc_interface::{interface, Queries};
use rustc_driver::Compilation;
use crate::test::Bencher;

Expand All @@ -16,10 +16,10 @@ struct MiriCompilerCalls<'a> {
}

impl rustc_driver::Callbacks for MiriCompilerCalls<'_> {
fn after_analysis(&mut self, compiler: &interface::Compiler) -> Compilation {
fn after_analysis<'tcx>(&mut self, compiler: &interface::Compiler, queries: &'tcx Queries<'tcx>) -> Compilation {
compiler.session().abort_if_errors();

compiler.global_ctxt().unwrap().peek_mut().enter(|tcx| {
queries.global_ctxt().unwrap().peek_mut().enter(|tcx| {
let (entry_def_id, _) = tcx.entry_fn(LOCAL_CRATE).expect(
"no main or start function found",
);
Expand Down
6 changes: 3 additions & 3 deletions src/bin/miri-rustc-tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::sync::{Mutex, Arc};
use std::io;


use rustc_interface::interface;
use rustc_interface::{interface, Queries};
use rustc::hir::{self, itemlikevisit};
use rustc::ty::TyCtxt;
use rustc::hir::def_id::LOCAL_CRATE;
Expand All @@ -29,9 +29,9 @@ struct MiriCompilerCalls {
}

impl rustc_driver::Callbacks for MiriCompilerCalls {
fn after_analysis(&mut self, compiler: &interface::Compiler) -> Compilation {
fn after_analysis<'tcx>(&mut self, compiler: &interface::Compiler, queries: &'tcx Queries<'tcx>) -> Compilation {
compiler.session().abort_if_errors();
compiler.global_ctxt().unwrap().peek_mut().enter(|tcx| {
queries.global_ctxt().unwrap().peek_mut().enter(|tcx| {
if std::env::args().any(|arg| arg == "--test") {
struct Visitor<'tcx>(TyCtxt<'tcx>);
impl<'tcx, 'hir> itemlikevisit::ItemLikeVisitor<'hir> for Visitor<'tcx> {
Expand Down
6 changes: 3 additions & 3 deletions src/bin/miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::env;

use hex::FromHexError;

use rustc_interface::interface;
use rustc_interface::{interface, Queries};
use rustc::hir::def_id::LOCAL_CRATE;
use rustc_driver::Compilation;

Expand All @@ -29,11 +29,11 @@ struct MiriCompilerCalls {
}

impl rustc_driver::Callbacks for MiriCompilerCalls {
fn after_analysis(&mut self, compiler: &interface::Compiler) -> Compilation {
fn after_analysis<'tcx>(&mut self, compiler: &interface::Compiler, queries: &'tcx Queries<'tcx>) -> Compilation {
init_late_loggers();
compiler.session().abort_if_errors();

compiler.global_ctxt().unwrap().peek_mut().enter(|tcx| {
queries.global_ctxt().unwrap().peek_mut().enter(|tcx| {
let (entry_def_id, _) = tcx.entry_fn(LOCAL_CRATE).expect("no main function found!");
let mut config = self.miri_config.clone();

Expand Down

0 comments on commit a971b8a

Please sign in to comment.