This commit is contained in:
Mateusz Mikuła 2018-06-29 12:52:04 +02:00
parent 9d8945e3e8
commit d4b98b221d
2 changed files with 3 additions and 3 deletions

View File

@ -90,7 +90,7 @@ fn after_analysis<'a, 'tcx>(state: &mut CompileState<'a, 'tcx>) {
struct Visitor<'a, 'tcx: 'a>(TyCtxt<'a, 'tcx, 'tcx>, &'a CompileState<'a, 'tcx>);
impl<'a, 'tcx: 'a, 'hir> itemlikevisit::ItemLikeVisitor<'hir> for Visitor<'a, 'tcx> {
fn visit_item(&mut self, i: &'hir hir::Item) {
if let hir::Item_::ItemFn(_, _, _, _, _, body_id) = i.node {
if let hir::Item_::ItemFn(.., body_id) = i.node {
if i.attrs.iter().any(|attr| attr.name() == "test") {
let did = self.0.hir.body_owner_def_id(body_id);
println!("running test: {}", self.0.def_path_debug_str(did));

View File

@ -25,7 +25,7 @@ use std::path::PathBuf;
struct MiriCompilerCalls {
default: Box<RustcDefaultCalls>,
/// Whether to begin interpretation at the start_fn lang item or not
///
///
/// If false, the interpretation begins at the `main` function
start_fn: bool,
}
@ -115,7 +115,7 @@ fn after_analysis<'a, 'tcx>(state: &mut CompileState<'a, 'tcx>, use_start_fn: bo
);
impl<'a, 'tcx: 'a, 'hir> itemlikevisit::ItemLikeVisitor<'hir> for Visitor<'a, 'tcx> {
fn visit_item(&mut self, i: &'hir hir::Item) {
if let hir::Item_::ItemFn(_, _, _, _, _, body_id) = i.node {
if let hir::Item_::ItemFn(.., body_id) = i.node {
if i.attrs.iter().any(|attr| {
attr.name() == "test"
})