use matches!() macro in more places
This commit is contained in:
@@ -131,10 +131,7 @@ impl Qualifs<'mir, 'tcx> {
|
||||
.body
|
||||
.basic_blocks()
|
||||
.iter_enumerated()
|
||||
.find(|(_, block)| match block.terminator().kind {
|
||||
TerminatorKind::Return => true,
|
||||
_ => false,
|
||||
})
|
||||
.find(|(_, block)| matches!(block.terminator().kind, TerminatorKind::Return))
|
||||
.map(|(bb, _)| bb);
|
||||
|
||||
let return_block = match return_block {
|
||||
|
||||
@@ -170,11 +170,12 @@ impl Qualif for NeedsNonConstDrop {
|
||||
let mut selcx = SelectionContext::with_constness(&infcx, hir::Constness::Const);
|
||||
selcx.select(&obligation)
|
||||
});
|
||||
match implsrc {
|
||||
Ok(Some(ImplSource::ConstDrop(_)))
|
||||
| Ok(Some(ImplSource::Param(_, ty::BoundConstness::ConstIfConst))) => false,
|
||||
_ => true,
|
||||
}
|
||||
!matches!(
|
||||
implsrc,
|
||||
Ok(Some(
|
||||
ImplSource::ConstDrop(_) | ImplSource::Param(_, ty::BoundConstness::ConstIfConst)
|
||||
))
|
||||
)
|
||||
}
|
||||
|
||||
fn in_adt_inherently(cx: &ConstCx<'_, 'tcx>, adt: &'tcx AdtDef, _: SubstsRef<'tcx>) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user