Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions compiler/rustc_trait_selection/src/solve/fulfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ where
}

fn collect_remaining_errors(&mut self, infcx: &InferCtxt<'tcx>) -> Vec<E> {
#[allow(clippy::iter_skip_zero)]
self.obligations
.pending
.drain(..)
Expand All @@ -194,6 +195,12 @@ where
.map(|obligation| NextSolverError::Overflow(obligation)),
)
.map(|e| E::from_solver_error(infcx, e))
// Skip doesn't implement TrustedLen, so we use it to
// avoid Vec::from_iter specialization that seems
// to optimize poorly in combination with ThinVec::drain
// on this particular sequence.
// See https://github.com/rust-lang/rust/pull/160073
.skip(0)
.collect()
}

Expand Down
Loading