diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index 61ce9291040..002ae1e3165 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -330,10 +330,7 @@ pub fn save_proc_macro_span(&self, span: Span) -> usize { pub fn proc_macro_quoted_spans(&self) -> impl Iterator + '_ { // This is equivalent to `.iter().copied().enumerate()`, but that isn't possible for // AppendOnlyVec, so we resort to this scheme. - (0..) - .map(|i| (i, self.proc_macro_quoted_spans.get(i))) - .take_while(|(_, o)| o.is_some()) - .filter_map(|(i, o)| Some((i, o?))) + self.proc_macro_quoted_spans.iter_enumerated() } #[track_caller]