1
Fork 0

Lower generic const items to HIR

This commit is contained in:
León Orell Valerian Liehr 2023-05-04 16:40:57 +02:00
parent afd009a8d8
commit 9213aec762
No known key found for this signature in database
GPG key ID: D17A07215F68E713
16 changed files with 84 additions and 41 deletions

View file

@ -1529,9 +1529,10 @@ declare_lint_pass!(
impl<'tcx> LateLintPass<'tcx> for UnusedBrokenConst {
fn check_item(&mut self, cx: &LateContext<'_>, it: &hir::Item<'_>) {
match it.kind {
hir::ItemKind::Const(_, body_id) => {
hir::ItemKind::Const(_, _, body_id) => {
let def_id = cx.tcx.hir().body_owner_def_id(body_id).to_def_id();
// trigger the query once for all constants since that will already report the errors
// FIXME(generic_const_items): Does this work properly with generic const items?
cx.tcx.ensure().const_eval_poly(def_id);
}
hir::ItemKind::Static(_, _, body_id) => {