Change enclosing_body_owner to return LocalDefId

Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
This commit is contained in:
Miguel Guarniz 2022-07-19 17:47:49 -04:00
parent 29a0f69f9c
commit ce5fa10cce

View File

@ -1353,7 +1353,7 @@ pub fn is_integer_const(cx: &LateContext<'_>, e: &Expr<'_>, value: u128) -> bool
if is_integer_literal(e, value) {
return true;
}
let enclosing_body = cx.tcx.hir().local_def_id(cx.tcx.hir().enclosing_body_owner(e.hir_id));
let enclosing_body = cx.tcx.hir().enclosing_body_owner(e.hir_id);
if let Some((Constant::Int(v), _)) = constant(cx, cx.tcx.typeck(enclosing_body), e) {
return value == v;
}