Lower generic const items to HIR
This commit is contained in:
parent
afd009a8d8
commit
9213aec762
16 changed files with 84 additions and 41 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue