From 6bd661ef1763fc41cba6ae4971ea877dd47b082b Mon Sep 17 00:00:00 2001 From: LingMan Date: Mon, 11 Jan 2021 22:22:04 +0100 Subject: [PATCH] Replace a simple `if let` with the `matches` macro --- compiler/rustc_resolve/src/late.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index 8544e1d8ee55a..6219d1b08eb68 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -1947,8 +1947,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> { _ => report_errors(self, None), }; - if let PathSource::TraitItem(..) = source { - } else { + if !matches!(source, PathSource::TraitItem(..)) { // Avoid recording definition of `A::B` in `::B::C`. self.r.record_partial_res(id, partial_res); }