@@ -9,7 +9,6 @@ use rustc_middle::{
99 } ,
1010 ty:: { self , ParamEnv , TyCtxt } ,
1111} ;
12- use rustc_span:: def_id:: DefId ;
1312
1413#[ derive( Copy , Clone , Debug ) ]
1514enum EdgeKind {
@@ -24,15 +23,14 @@ pub struct Validator {
2423
2524impl < ' tcx > MirPass < ' tcx > for Validator {
2625 fn run_pass ( & self , tcx : TyCtxt < ' tcx > , source : MirSource < ' tcx > , body : & mut Body < ' tcx > ) {
27- let def_id = source. def_id ( ) ;
28- let param_env = tcx. param_env ( def_id) ;
29- TypeChecker { when : & self . when , def_id, body, tcx, param_env } . visit_body ( body) ;
26+ let param_env = tcx. param_env ( source. def_id ( ) ) ;
27+ TypeChecker { when : & self . when , source, body, tcx, param_env } . visit_body ( body) ;
3028 }
3129}
3230
3331struct TypeChecker < ' a , ' tcx > {
3432 when : & ' a str ,
35- def_id : DefId ,
33+ source : MirSource < ' tcx > ,
3634 body : & ' a Body < ' tcx > ,
3735 tcx : TyCtxt < ' tcx > ,
3836 param_env : ParamEnv < ' tcx > ,
@@ -47,7 +45,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
4745 span,
4846 & format ! (
4947 "broken MIR in {:?} ({}) at {:?}:\n {}" ,
50- self . def_id ,
48+ self . source . instance ,
5149 self . when,
5250 location,
5351 msg. as_ref( )
0 commit comments