@@ -9,7 +9,6 @@ use rustc_middle::{
9
9
} ,
10
10
ty:: { self , ParamEnv , TyCtxt } ,
11
11
} ;
12
- use rustc_span:: def_id:: DefId ;
13
12
14
13
#[ derive( Copy , Clone , Debug ) ]
15
14
enum EdgeKind {
@@ -24,15 +23,14 @@ pub struct Validator {
24
23
25
24
impl < ' tcx > MirPass < ' tcx > for Validator {
26
25
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) ;
30
28
}
31
29
}
32
30
33
31
struct TypeChecker < ' a , ' tcx > {
34
32
when : & ' a str ,
35
- def_id : DefId ,
33
+ source : MirSource < ' tcx > ,
36
34
body : & ' a Body < ' tcx > ,
37
35
tcx : TyCtxt < ' tcx > ,
38
36
param_env : ParamEnv < ' tcx > ,
@@ -47,7 +45,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
47
45
span,
48
46
& format ! (
49
47
"broken MIR in {:?} ({}) at {:?}:\n {}" ,
50
- self . def_id ,
48
+ self . source . instance ,
51
49
self . when,
52
50
location,
53
51
msg. as_ref( )
0 commit comments