Remove diagnostic_only_typeck and fix placeholder suggestion for const/static

This commit is contained in:
Michael Goulet 2025-01-02 18:18:19 +00:00
parent c5d4996404
commit c529fe0475
14 changed files with 85 additions and 82 deletions

View file

@ -412,7 +412,7 @@ fn infer_placeholder_type<'tcx>(
kind: &'static str,
) -> Ty<'tcx> {
let tcx = cx.tcx();
let ty = tcx.diagnostic_only_typeck(def_id).node_type(body_id.hir_id);
let ty = tcx.typeck(def_id).node_type(body_id.hir_id);
// If this came from a free `const` or `static mut?` item,
// then the user may have written e.g. `const A = 42;`.