|
1 | 1 | // Not in interpret to make sure we do not use private implementation details
|
2 | 2 |
|
3 | 3 | use rustc_abi::VariantIdx;
|
4 |
| -use rustc_middle::query::{Key, TyCtxtAt}; |
| 4 | +use rustc_middle::query::Key; |
5 | 5 | use rustc_middle::ty::layout::LayoutOf;
|
6 | 6 | use rustc_middle::ty::{self, Ty, TyCtxt};
|
7 | 7 | use rustc_middle::{bug, mir};
|
@@ -35,16 +35,17 @@ pub(crate) type ValTreeCreationResult<'tcx> = Result<ty::ValTree<'tcx>, ValTreeC
|
35 | 35 |
|
36 | 36 | #[instrument(skip(tcx), level = "debug")]
|
37 | 37 | pub(crate) fn try_destructure_mir_constant_for_user_output<'tcx>(
|
38 |
| - tcx: TyCtxtAt<'tcx>, |
| 38 | + tcx: TyCtxt<'tcx>, |
39 | 39 | val: mir::ConstValue<'tcx>,
|
40 | 40 | ty: Ty<'tcx>,
|
41 | 41 | ) -> Option<mir::DestructuredConstant<'tcx>> {
|
42 | 42 | let typing_env = ty::TypingEnv::fully_monomorphized();
|
43 |
| - let (ecx, op) = mk_eval_cx_for_const_val(tcx, typing_env, val, ty)?; |
| 43 | + // FIXME: use a proper span here? |
| 44 | + let (ecx, op) = mk_eval_cx_for_const_val(tcx.at(rustc_span::DUMMY_SP), typing_env, val, ty)?; |
44 | 45 |
|
45 | 46 | // We go to `usize` as we cannot allocate anything bigger anyway.
|
46 | 47 | let (field_count, variant, down) = match ty.kind() {
|
47 |
| - ty::Array(_, len) => (len.try_to_target_usize(tcx.tcx)? as usize, None, op), |
| 48 | + ty::Array(_, len) => (len.try_to_target_usize(tcx)? as usize, None, op), |
48 | 49 | ty::Adt(def, _) if def.variants().is_empty() => {
|
49 | 50 | return None;
|
50 | 51 | }
|
|
0 commit comments