Greatly simplify lifetime captures in edition 2024
This commit is contained in:
parent
46420c9607
commit
12e3911d81
84 changed files with 223 additions and 294 deletions
|
@ -343,7 +343,7 @@ impl<'tcx> MovePathLookup<'tcx> {
|
|||
/// `MovePathIndex`es.
|
||||
pub fn iter_locals_enumerated(
|
||||
&self,
|
||||
) -> impl DoubleEndedIterator<Item = (Local, MovePathIndex)> + '_ {
|
||||
) -> impl DoubleEndedIterator<Item = (Local, MovePathIndex)> {
|
||||
self.locals.iter_enumerated().filter_map(|(l, &idx)| Some((l, idx?)))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ impl<'tcx> UnDerefer<'tcx> {
|
|||
pub(crate) fn iter_projections(
|
||||
&self,
|
||||
place: PlaceRef<'tcx>,
|
||||
) -> impl Iterator<Item = (PlaceRef<'tcx>, PlaceElem<'tcx>)> + '_ {
|
||||
) -> impl Iterator<Item = (PlaceRef<'tcx>, PlaceElem<'tcx>)> {
|
||||
ProjectionIter::new(self.deref_chain(place.local), place)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ use std::fmt::{Debug, Formatter};
|
|||
use std::ops::Range;
|
||||
|
||||
use rustc_abi::{FieldIdx, VariantIdx};
|
||||
use rustc_data_structures::captures::Captures;
|
||||
use rustc_data_structures::fx::{FxHashMap, FxIndexSet, StdEntry};
|
||||
use rustc_data_structures::stack::ensure_sufficient_stack;
|
||||
use rustc_index::IndexVec;
|
||||
|
@ -676,10 +675,7 @@ impl<'tcx> Map<'tcx> {
|
|||
}
|
||||
|
||||
/// Iterate over all direct children.
|
||||
fn children(
|
||||
&self,
|
||||
parent: PlaceIndex,
|
||||
) -> impl Iterator<Item = PlaceIndex> + Captures<'_> + Captures<'tcx> {
|
||||
fn children(&self, parent: PlaceIndex) -> impl Iterator<Item = PlaceIndex> {
|
||||
Children::new(self, parent)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue