Skip to content

Commit a971b8a

Browse files
committed
fix for GlobalCtxt changes
1 parent 392d745 commit a971b8a

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

benches/helpers/miri_helper.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extern crate test;
77

88
use self::miri::eval_main;
99
use rustc::hir::def_id::LOCAL_CRATE;
10-
use rustc_interface::interface;
10+
use rustc_interface::{interface, Queries};
1111
use rustc_driver::Compilation;
1212
use crate::test::Bencher;
1313

@@ -16,10 +16,10 @@ struct MiriCompilerCalls<'a> {
1616
}
1717

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

22-
compiler.global_ctxt().unwrap().peek_mut().enter(|tcx| {
22+
queries.global_ctxt().unwrap().peek_mut().enter(|tcx| {
2323
let (entry_def_id, _) = tcx.entry_fn(LOCAL_CRATE).expect(
2424
"no main or start function found",
2525
);

src/bin/miri-rustc-tests.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::sync::{Mutex, Arc};
1515
use std::io;
1616

1717

18-
use rustc_interface::interface;
18+
use rustc_interface::{interface, Queries};
1919
use rustc::hir::{self, itemlikevisit};
2020
use rustc::ty::TyCtxt;
2121
use rustc::hir::def_id::LOCAL_CRATE;
@@ -29,9 +29,9 @@ struct MiriCompilerCalls {
2929
}
3030

3131
impl rustc_driver::Callbacks for MiriCompilerCalls {
32-
fn after_analysis(&mut self, compiler: &interface::Compiler) -> Compilation {
32+
fn after_analysis<'tcx>(&mut self, compiler: &interface::Compiler, queries: &'tcx Queries<'tcx>) -> Compilation {
3333
compiler.session().abort_if_errors();
34-
compiler.global_ctxt().unwrap().peek_mut().enter(|tcx| {
34+
queries.global_ctxt().unwrap().peek_mut().enter(|tcx| {
3535
if std::env::args().any(|arg| arg == "--test") {
3636
struct Visitor<'tcx>(TyCtxt<'tcx>);
3737
impl<'tcx, 'hir> itemlikevisit::ItemLikeVisitor<'hir> for Visitor<'tcx> {

src/bin/miri.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::env;
2020

2121
use hex::FromHexError;
2222

23-
use rustc_interface::interface;
23+
use rustc_interface::{interface, Queries};
2424
use rustc::hir::def_id::LOCAL_CRATE;
2525
use rustc_driver::Compilation;
2626

@@ -29,11 +29,11 @@ struct MiriCompilerCalls {
2929
}
3030

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

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

0 commit comments

Comments
 (0)