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

@ -997,7 +997,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
continue;
};
let pat = match tcx.hir().get(arg.pat.hir_id) {
Node::Pat(pat) | Node::Binding(pat) => pat,
Node::Pat(pat) => pat,
node => bug!("pattern became {:?}", node),
};
let pattern = pat_from_hir(tcx, self.param_env, self.typeck_results, pat);

View file

@ -80,7 +80,7 @@ impl<'tcx> Cx<'tcx> {
#[tracing::instrument(level = "debug", skip(self))]
pub(crate) fn pattern_from_hir(&mut self, p: &hir::Pat<'_>) -> Pat<'tcx> {
let p = match self.tcx.hir().get(p.hir_id) {
Node::Pat(p) | Node::Binding(p) => p,
Node::Pat(p) => p,
node => bug!("pattern became {:?}", node),
};
pat_from_hir(self.tcx, self.param_env, self.typeck_results(), p)