about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-09-20 12:08:17 +0200
committerGitHub <noreply@github.com>2020-09-20 12:08:17 +0200
commit9b9192a2d5dfd5f121ec608a7eee09201e7de807 (patch)
tree2783122b1a18217a6a4bbd575973d52cdff6ecab /compiler
parentb603143c9e8f535219d7ba348d7efaf634dd0071 (diff)
parent94dae6004035c356b00dac8764c1b4808d740928 (diff)
downloadrust-9b9192a2d5dfd5f121ec608a7eee09201e7de807.tar.gz
rust-9b9192a2d5dfd5f121ec608a7eee09201e7de807.zip
Rollup merge of #76809 - matthiaskrgr:simplify_cond, r=varkor
simplfy condition in ItemLowerer::with_trait_impl_ref()
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_ast_lowering/src/item.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs
index 6d41b7836b1..617cacee0e7 100644
--- a/compiler/rustc_ast_lowering/src/item.rs
+++ b/compiler/rustc_ast_lowering/src/item.rs
@@ -27,7 +27,7 @@ pub(super) struct ItemLowerer<'a, 'lowering, 'hir> {
 impl ItemLowerer<'_, '_, '_> {
     fn with_trait_impl_ref(&mut self, impl_ref: &Option<TraitRef>, f: impl FnOnce(&mut Self)) {
         let old = self.lctx.is_in_trait_impl;
-        self.lctx.is_in_trait_impl = if let &None = impl_ref { false } else { true };
+        self.lctx.is_in_trait_impl = impl_ref.is_some();
         f(self);
         self.lctx.is_in_trait_impl = old;
     }