|
1 | 1 | use rustc_hir::LangItem; |
2 | 2 | use rustc_middle::mir; |
| 3 | +use rustc_middle::query::TyCtxtAt; |
| 4 | +use rustc_middle::ty; |
3 | 5 | use rustc_middle::ty::layout::LayoutOf; |
4 | | -use rustc_middle::ty::{self, TyCtxt}; |
5 | | -use rustc_span::{source_map::DUMMY_SP, symbol::Symbol}; |
| 6 | +use rustc_span::symbol::Symbol; |
6 | 7 | use rustc_type_ir::Mutability; |
7 | 8 |
|
8 | 9 | use crate::const_eval::{mk_eval_cx, CanAccessStatics, CompileTimeEvalContext}; |
@@ -49,11 +50,13 @@ fn alloc_caller_location<'mir, 'tcx>( |
49 | 50 | } |
50 | 51 |
|
51 | 52 | pub(crate) fn const_caller_location_provider( |
52 | | - tcx: TyCtxt<'_>, |
53 | | - (file, line, col): (Symbol, u32, u32), |
| 53 | + tcx: TyCtxtAt<'_>, |
| 54 | + file: Symbol, |
| 55 | + line: u32, |
| 56 | + col: u32, |
54 | 57 | ) -> mir::ConstValue<'_> { |
55 | 58 | trace!("const_caller_location: {}:{}:{}", file, line, col); |
56 | | - let mut ecx = mk_eval_cx(tcx, DUMMY_SP, ty::ParamEnv::reveal_all(), CanAccessStatics::No); |
| 59 | + let mut ecx = mk_eval_cx(tcx.tcx, tcx.span, ty::ParamEnv::reveal_all(), CanAccessStatics::No); |
57 | 60 |
|
58 | 61 | let loc_place = alloc_caller_location(&mut ecx, file, line, col); |
59 | 62 | if intern_const_alloc_recursive(&mut ecx, InternKind::Constant, &loc_place).is_err() { |
|
0 commit comments