Skip to content

fix for GlobalCtxt changes #1088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
809e180a76ce97340bf4354ff357bc59e3ca40b2
4007d4ef26eab44bdabc2b7574d032152264d3ad
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