Merge pull request #599 from solson/rustup
Update to latest rustc master
This commit is contained in:
commit
1cd85d2a27
@ -6,6 +6,7 @@ extern crate test;
|
||||
|
||||
use self::miri::eval_main;
|
||||
use self::rustc_driver::{driver, Compilation};
|
||||
use rustc::hir::def_id::LOCAL_CRATE;
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
use crate::test::Bencher;
|
||||
@ -44,10 +45,9 @@ pub fn run(filename: &str, bencher: &mut Bencher) {
|
||||
state.session.abort_if_errors();
|
||||
|
||||
let tcx = state.tcx.unwrap();
|
||||
let (entry_node_id, _, _) = state.session.entry_fn.borrow().expect(
|
||||
let (entry_def_id, _) = tcx.entry_fn(LOCAL_CRATE).expect(
|
||||
"no main or start function found",
|
||||
);
|
||||
let entry_def_id = tcx.hir().local_def_id(entry_node_id);
|
||||
|
||||
bencher.borrow_mut().iter(|| {
|
||||
eval_main(tcx, entry_def_id, false);
|
||||
|
@ -1 +1 @@
|
||||
nightly-2018-12-26
|
||||
nightly-2019-01-21
|
||||
|
@ -23,6 +23,7 @@ use rustc::hir::{self, itemlikevisit};
|
||||
use rustc_codegen_utils::codegen_backend::CodegenBackend;
|
||||
use rustc::ty::TyCtxt;
|
||||
use syntax::ast;
|
||||
use rustc::hir::def_id::LOCAL_CRATE;
|
||||
|
||||
struct MiriCompilerCalls {
|
||||
default: Box<RustcDefaultCalls>,
|
||||
@ -104,8 +105,7 @@ fn after_analysis<'a, 'tcx>(state: &mut CompileState<'a, 'tcx>) {
|
||||
fn visit_impl_item(&mut self, _impl_item: &'hir hir::ImplItem) {}
|
||||
}
|
||||
state.hir_crate.unwrap().visit_all_item_likes(&mut Visitor(tcx, state));
|
||||
} else if let Some((entry_node_id, _, _)) = *state.session.entry_fn.borrow() {
|
||||
let entry_def_id = tcx.hir().local_def_id(entry_node_id);
|
||||
} else if let Some((entry_def_id, _)) = tcx.entry_fn(LOCAL_CRATE) {
|
||||
miri::eval_main(tcx, entry_def_id, /*validate*/true);
|
||||
|
||||
state.session.abort_if_errors();
|
||||
|
@ -24,6 +24,7 @@ use rustc_driver::{Compilation, CompilerCalls, RustcDefaultCalls};
|
||||
use rustc_driver::driver::{CompileState, CompileController};
|
||||
use rustc::session::config::{self, Input, ErrorOutputType};
|
||||
use rustc_codegen_utils::codegen_backend::CodegenBackend;
|
||||
use rustc::hir::def_id::LOCAL_CRATE;
|
||||
use syntax::ast;
|
||||
|
||||
struct MiriCompilerCalls {
|
||||
@ -113,8 +114,8 @@ fn after_analysis<'a, 'tcx>(
|
||||
|
||||
let tcx = state.tcx.unwrap();
|
||||
|
||||
let (entry_node_id, _, _) = state.session.entry_fn.borrow().expect("no main function found!");
|
||||
let entry_def_id = tcx.hir().local_def_id(entry_node_id);
|
||||
|
||||
let (entry_def_id, _) = tcx.entry_fn(LOCAL_CRATE).expect("no main function found!");
|
||||
|
||||
miri::eval_main(tcx, entry_def_id, validate);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user