1
Fork 0

Rollup merge of #98639 - camsteffen:no-node-binding, r=compiler-errors

Factor out `hir::Node::Binding`
This commit is contained in:
Dylan DPC 2022-07-02 12:23:38 +05:30 committed by GitHub
commit d287726aa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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);
}