about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2021-01-12 16:13:33 +0900
committerGitHub <noreply@github.com>2021-01-12 16:13:33 +0900
commit8c342da22eb7cec90b673ea5fc305bca0b8afe13 (patch)
tree42287331ce338363a1f4d74b4be2775246e682a5
parent961a4386cd2c7dff31b9ab0cdbd33b98195a1e9f (diff)
parent6bd661ef1763fc41cba6ae4971ea877dd47b082b (diff)
downloadrust-8c342da22eb7cec90b673ea5fc305bca0b8afe13.tar.gz
rust-8c342da22eb7cec90b673ea5fc305bca0b8afe13.zip
Rollup merge of #80927 - LingMan:matches, r=estebank
Replace a simple `if let` with the `matches` macro

`@rustbot` modify labels +C-cleanup +T-compiler
-rw-r--r--compiler/rustc_resolve/src/late.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs
index 8544e1d8ee5..6219d1b08eb 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 `<T as A>::B::C`.
             self.r.record_partial_res(id, partial_res);
         }