From ea674ecb09a9d6ecd08c3c209b56e3abe084b5cf Mon Sep 17 00:00:00 2001 From: Tim Siegel Date: Wed, 4 Mar 2026 14:09:56 -0500 Subject: [PATCH] core: lift FIXME comment from option.rs to iter::try_process This FIXME is relevant not only to Option but other similar cases that use iter::try_process(). The referenced issue 11084 was closed in 2021, and the related PR 59605 was not merged due to inconclusive results. --- library/core/src/iter/adapters/mod.rs | 3 +++ library/core/src/option.rs | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/core/src/iter/adapters/mod.rs b/library/core/src/iter/adapters/mod.rs index d0b89fdbb5843..ca950a138f31c 100644 --- a/library/core/src/iter/adapters/mod.rs +++ b/library/core/src/iter/adapters/mod.rs @@ -155,6 +155,9 @@ where for<'a> F: FnMut(GenericShunt<'a, I, R>) -> U, R: Residual, { + // FIXME(#11084): we might be able to get rid of GenericShunt in favor of + // Iterator::scan, as performance should be comparable + let mut residual = None; let shunt = GenericShunt { iter, residual: &mut residual }; let value = f(shunt); diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 8920ea959eb38..d4dd33b948193 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -2758,9 +2758,6 @@ impl> FromIterator> for Option { /// so the final value of `shared` is 6 (= `3 + 2 + 1`), not 16. #[inline] fn from_iter>>(iter: I) -> Option { - // FIXME(#11084): This could be replaced with Iterator::scan when this - // performance bug is closed. - iter::try_process(iter.into_iter(), |i| i.collect()) } }