Skip to content

Commit

Permalink
Rollup merge of #93631 - notriddle:notriddle/cleanup-some-into-iter, …
Browse files Browse the repository at this point in the history
…r=oli-obk

rustc_mir_dataflow: use iter::once instead of Some().into_iter
  • Loading branch information
matthiaskrgr committed Feb 3, 2022
2 parents 5e7c35a + a2a4cab commit e1004a3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler/rustc_mir_dataflow/src/elaborate_drops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc_middle::ty::subst::SubstsRef;
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)]
Expand Down Expand Up @@ -329,8 +329,7 @@ where
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
Expand Down

0 comments on commit e1004a3

Please sign in to comment.