align with rust-lang/rust/#58836

This commit is contained in:
ljedrz
2019-03-01 13:26:06 +01:00
parent f2587703cc
commit f3363b9cf2
20 changed files with 80 additions and 82 deletions

View File

@@ -38,7 +38,7 @@ impl LintPass for EmptyEnum {
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EmptyEnum {
fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &Item) {
let did = cx.tcx.hir().local_def_id(item.id);
let did = cx.tcx.hir().local_def_id_from_hir_id(item.hir_id);
if let ItemKind::Enum(..) = item.node {
let ty = cx.tcx.type_of(did);
let adt = ty.ty_adt_def().expect("already checked whether this is an enum");