Greatly simplify lifetime captures in edition 2024
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
use std::collections::VecDeque;
|
||||
|
||||
use rustc_data_structures::captures::Captures;
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_middle::mir;
|
||||
use rustc_span::{DesugaringKind, ExpnKind, MacroKind, Span};
|
||||
@@ -182,7 +181,7 @@ fn divide_spans_into_buckets(input_covspans: Vec<Covspan>, holes: &[Hole]) -> Ve
|
||||
fn drain_front_while<'a, T>(
|
||||
queue: &'a mut VecDeque<T>,
|
||||
mut pred_fn: impl FnMut(&T) -> bool,
|
||||
) -> impl Iterator<Item = T> + Captures<'a> {
|
||||
) -> impl Iterator<Item = T> {
|
||||
std::iter::from_fn(move || if pred_fn(queue.front()?) { queue.pop_front() } else { None })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user