Skip to content

Commit 61fc727

Browse files
committed
let_chains: Fuse PatternSource::Let & ::LetExpr.
1 parent a505d9d commit 61fc727

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/librustc_resolve/lib.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,6 @@ type BindingMap = FxHashMap<Ident, BindingInfo>;
485485
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
486486
enum PatternSource {
487487
Match,
488-
// FIXME(54883): Consider fusing with `Let` below once let-statements support or-patterns.
489-
LetExpr,
490488
Let,
491489
For,
492490
FnParam,
@@ -496,7 +494,7 @@ impl PatternSource {
496494
fn descr(self) -> &'static str {
497495
match self {
498496
PatternSource::Match => "match binding",
499-
PatternSource::Let | PatternSource::LetExpr => "let binding",
497+
PatternSource::Let => "let binding",
500498
PatternSource::For => "for binding",
501499
PatternSource::FnParam => "function parameter",
502500
}
@@ -3153,7 +3151,7 @@ impl<'a> Resolver<'a> {
31533151
);
31543152
}
31553153
Some(..) if pat_src == PatternSource::Match ||
3156-
pat_src == PatternSource::LetExpr => {
3154+
pat_src == PatternSource::Let => {
31573155
// `Variant1(a) | Variant2(a)`, ok
31583156
// Reuse definition from the first `a`.
31593157
res = self.ribs[ValueNS].last_mut().unwrap().bindings[&ident];
@@ -4348,7 +4346,7 @@ impl<'a> Resolver<'a> {
43484346

43494347
ExprKind::Let(ref pats, ref scrutinee) => {
43504348
self.visit_expr(scrutinee);
4351-
self.resolve_pats(pats, PatternSource::LetExpr);
4349+
self.resolve_pats(pats, PatternSource::Let);
43524350
}
43534351

43544352
ExprKind::If(ref cond, ref then, ref opt_else) => {

0 commit comments

Comments
 (0)