@@ -68,12 +68,36 @@ pub fn mk_eval_cx<'a, 'tcx>(
68
68
debug ! ( "mk_eval_cx: {:?}, {:?}" , instance, param_env) ;
69
69
let span = tcx. def_span ( instance. def_id ( ) ) ;
70
70
let mut ecx = EvalContext :: new ( tcx. at ( span) , param_env, CompileTimeInterpreter :: new ( ) ) ;
71
- let mir = ecx. load_mir ( instance. def ) ?;
71
+ let mir = mir:: Mir :: new (
72
+ :: std:: iter:: once (
73
+ mir:: BasicBlockData {
74
+ statements : Vec :: new ( ) ,
75
+ is_cleanup : false ,
76
+ terminator : Some ( mir:: Terminator {
77
+ source_info : mir:: SourceInfo {
78
+ scope : mir:: OUTERMOST_SOURCE_SCOPE ,
79
+ span : DUMMY_SP ,
80
+ } ,
81
+ kind : mir:: TerminatorKind :: Return ,
82
+ } ) ,
83
+ }
84
+ ) . collect ( ) , // basic blocks
85
+ IndexVec :: new ( ) , // source_scopes
86
+ mir:: ClearCrossCrate :: Clear , // source_scope_local_data
87
+ IndexVec :: new ( ) , // promoted
88
+ None , // yield ty
89
+ :: std:: iter:: once ( mir:: LocalDecl :: new_return_place ( tcx. types . unit , DUMMY_SP ) ) . collect ( ) ,
90
+ IndexVec :: new ( ) , //user_type_annotations
91
+ 0 , // arg_count
92
+ Vec :: new ( ) , // upvar_decls
93
+ DUMMY_SP , // span
94
+ Vec :: new ( ) , // control_flow_destroyed
95
+ ) ;
72
96
// insert a stack frame so any queries have the correct substs
73
97
ecx. push_stack_frame (
74
98
instance,
75
- mir . span ,
76
- mir,
99
+ span,
100
+ tcx . alloc_mir ( mir) ,
77
101
None ,
78
102
StackPopCleanup :: Goto ( None ) , // never pop
79
103
) ?;
0 commit comments