Skip to content

Commit

Permalink
Rollup merge of rust-lang#76809 - matthiaskrgr:simplify_cond, r=varkor
Browse files Browse the repository at this point in the history
simplfy condition in ItemLowerer::with_trait_impl_ref()
  • Loading branch information
Dylan-DPC committed Sep 19, 2020
2 parents a2e1b15 + 94dae60 commit 52891e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 52891e0

Please sign in to comment.