Rollup merge of #93631 - notriddle:notriddle/cleanup-some-into-iter, r=oli-obk

rustc_mir_dataflow: use iter::once instead of Some().into_iter
This commit is contained in:
Matthias Krüger 2022-02-04 14:59:06 +01:00 committed by GitHub
commit 4b7035918c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,7 @@
use rustc_middle::ty::util::IntTypeExt;
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_target::abi::VariantIdx;
use std::fmt;
use std::{fmt, iter};
/// The value of an inserted drop flag.
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
@ -329,8 +329,7 @@ fn drop_halfladder(
mut succ: BasicBlock,
fields: &[(Place<'tcx>, Option<D::Path>)],
) -> Vec<BasicBlock> {
Some(succ)
.into_iter()
iter::once(succ)
.chain(fields.iter().rev().zip(unwind_ladder).map(|(&(place, path), &unwind_succ)| {
succ = self.drop_subpath(place, path, succ, unwind_succ);
succ