Remove kw::Extra
checks that are no longer necessary.
Thanks to the introduction of `PatKind::Missing`.
This commit is contained in:
parent
9f089e080c
commit
909f449247
3 changed files with 6 additions and 20 deletions
|
@ -3999,22 +3999,17 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
|
|||
self.report_error(ident.span, error(ident));
|
||||
}
|
||||
|
||||
// Record as bound if it's valid:
|
||||
let ident_valid = ident.name != kw::Empty;
|
||||
if ident_valid {
|
||||
bindings.last_mut().unwrap().1.insert(ident);
|
||||
}
|
||||
// Record as bound.
|
||||
bindings.last_mut().unwrap().1.insert(ident);
|
||||
|
||||
if already_bound_or {
|
||||
// `Variant1(a) | Variant2(a)`, ok
|
||||
// Reuse definition from the first `a`.
|
||||
self.innermost_rib_bindings(ValueNS)[&ident]
|
||||
} else {
|
||||
// A completely fresh binding is added to the set.
|
||||
let res = Res::Local(pat_id);
|
||||
if ident_valid {
|
||||
// A completely fresh binding add to the set if it's valid.
|
||||
self.innermost_rib_bindings(ValueNS).insert(ident, res);
|
||||
}
|
||||
self.innermost_rib_bindings(ValueNS).insert(ident, res);
|
||||
res
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue