1
Fork 0

Rollup merge of #80344 - matthiaskrgr:matches, r=Dylan-DPC

use matches!() macro in more places
This commit is contained in:
Dylan DPC 2020-12-28 14:13:12 +01:00 committed by GitHub
commit c51172f38a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 137 additions and 266 deletions

View file

@ -112,12 +112,12 @@ impl<Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
};
// Allow uses of projections that are ZSTs or from scalar fields.
let is_consume = match context {
let is_consume = matches!(
context,
PlaceContext::NonMutatingUse(
NonMutatingUseContext::Copy | NonMutatingUseContext::Move,
) => true,
_ => false,
};
)
);
if is_consume {
let base_ty =
mir::Place::ty_from(place_ref.local, proj_base, self.fx.mir, cx.tcx());