use precise spans for recursive const evaluation

This commit is contained in:
Ralf Jung
2022-06-04 15:48:16 -04:00
parent 9ab4f876a1
commit 467e0f4446
8 changed files with 28 additions and 14 deletions

View File

@@ -926,7 +926,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
self.param_env
};
let param_env = param_env.with_const();
let val = self.tcx.eval_to_allocation_raw(param_env.and(gid))?;
// Use a precise span for better cycle errors.
let val = self.tcx.at(self.cur_span()).eval_to_allocation_raw(param_env.and(gid))?;
self.raw_const_to_mplace(val)
}