const-eval: make lint scope computation consistent

This commit is contained in:
Ralf Jung 2024-06-13 11:30:24 +02:00
parent b316033dd8
commit 54e24c1573
4 changed files with 25 additions and 30 deletions

View file

@ -114,7 +114,7 @@ fn eval_body_using_ecx<'tcx, R: InterpretationResult<'tcx>>(
let err_diag = errors::MutablePtrInFinal { span: ecx.tcx.span, kind: intern_kind };
ecx.tcx.emit_node_span_lint(
lint::builtin::CONST_EVAL_MUTABLE_PTR_IN_FINAL_VALUE,
ecx.best_lint_scope(),
ecx.machine.best_lint_scope(*ecx.tcx),
err_diag.span,
err_diag,
)