1
Fork 0

Replace Fn impls with RPIT impls in rustc_index

This is cleaner and removes an unstable feature usage
This commit is contained in:
bjorn3 2021-10-02 19:47:04 +02:00
parent e98f28907e
commit 9f4cb862ca
5 changed files with 23 additions and 50 deletions

View file

@ -1,6 +1,5 @@
use core::slice::Iter;
use rustc_data_structures::fx::FxHashMap;
use rustc_index::vec::{Enumerated, IndexVec};
use rustc_index::vec::IndexVec;
use rustc_middle::mir::*;
use rustc_middle::ty::{ParamEnv, Ty, TyCtxt};
use rustc_span::Span;
@ -337,7 +336,9 @@ impl MovePathLookup {
/// An enumerated iterator of `local`s and their associated
/// `MovePathIndex`es.
pub fn iter_locals_enumerated(&self) -> Enumerated<Local, Iter<'_, MovePathIndex>> {
pub fn iter_locals_enumerated(
&self,
) -> impl DoubleEndedIterator<Item = (Local, &MovePathIndex)> + ExactSizeIterator {
self.locals.iter_enumerated()
}
}