Factor out hir::Node::Binding

This commit is contained in:
Cameron Steffen 2022-06-28 13:15:30 -05:00
parent ca1e68b322
commit ec82bc1996
18 changed files with 22 additions and 37 deletions

View file

@ -244,7 +244,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
// for a generator).
let var_hir_id = captured_place.get_root_variable();
let node = self.ecx.tcx.hir().get(var_hir_id);
if let hir::Node::Binding(pat) = node {
if let hir::Node::Pat(pat) = node {
if let hir::PatKind::Binding(_, _, ident, _) = pat.kind {
name = Some(ident.name);
}