rustbot
added
S-waiting-on-review
labels
Jul 29, 2026
rustbot
added
the
S-waiting-on-author
label
Jul 29, 2026
rust-bors
Bot
added
the
S-waiting-on-bors
label
Jul 29, 2026
rust-bors
Bot
removed
the
S-waiting-on-author
label
Jul 29, 2026jhpratt added a commit to jhpratt/rust that referenced this pull request
Jul 29, 2026…on, r=joboet iter: specialize Take::count using advance_by Right now, when you call .count() on a Take iterator, it visits every single item one by one just to count them. That's slow. For example, if you have 1000 items and call .take(5).count(), it should just skip 5 items and return 5 — but today it actually goes through each item manually. This PR fixes that by using advance_by to skip items in bulk instead of visiting each one. After the skip, we know exactly how many items were consumed, so we return that number directly. This makes .count() faster for Take iterators, especially when the underlying iterator supports fast skipping.
Closed
rust-bors Bot pushed a commit that referenced this pull request
Jul 29, 2026Rollup of 18 pull requests Successful merges: - #159130 (a bit optimize four-digit chunks in integer formatting) - #159592 (core: implement bounded random sampling) - #159898 (Add intrinsic-test alias and set sample rate) - #158247 (hermit/fs: Return `unsupported()` instead of `from_raw_os_error(22)`) - #158649 (Hermit: fix `readdir()` ) - #159049 (Avoid ICE in From/TryFrom cast suggestion when encountering HRTBs) - #160053 (test: add test suite for the 85681 issue) - #160087 (Add regression test for nested associated-type projection ICE) - #160090 (rustc_resolve: Further reduce mutability in resolver) - #160099 (Resolver: split module resolutions into local and external resolutions) - #160106 (Add suggestions for `must_implement_one_of`) - #160117 (Remove unnecessary format usage) - #160134 (Work around Wine bug 60084 by calling WSAStartup at most once) - #160139 (iter: specialize Take::count using advance_by) - #160142 (bootstrap: remove use-lld config alias) - #160148 (Rename `errors.rs` file to `diagnostics.rs` (15/N)) - #160151 (Mark a doctest as requiring unwinding) - #160166 (Use correct feature gates for `f16`/`f128` `From` impls)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request
Jul 29, 2026…on, r=joboet iter: specialize Take::count using advance_by Right now, when you call .count() on a Take iterator, it visits every single item one by one just to count them. That's slow. For example, if you have 1000 items and call .take(5).count(), it should just skip 5 items and return 5 — but today it actually goes through each item manually. This PR fixes that by using advance_by to skip items in bulk instead of visiting each one. After the skip, we know exactly how many items were consumed, so we return that number directly. This makes .count() faster for Take iterators, especially when the underlying iterator supports fast skipping.
Closed
rust-bors Bot pushed a commit that referenced this pull request
Jul 29, 2026…uwer Rollup of 18 pull requests Successful merges: - #159898 (Add intrinsic-test alias and set sample rate) - #158247 (hermit/fs: Return `unsupported()` instead of `from_raw_os_error(22)`) - #158649 (Hermit: fix `readdir()` ) - #158693 (Add type-check to offload intrinisc calls) - #159049 (Avoid ICE in From/TryFrom cast suggestion when encountering HRTBs) - #159411 ([rustdoc] Correctly handle output options with --show-coverage) - #160053 (test: add test suite for the 85681 issue) - #160087 (Add regression test for nested associated-type projection ICE) - #160090 (rustc_resolve: Further reduce mutability in resolver) - #160099 (Resolver: split module resolutions into local and external resolutions) - #160106 (Add suggestions for `must_implement_one_of`) - #160117 (Remove unnecessary format usage) - #160134 (Work around Wine bug 60084 by calling WSAStartup at most once) - #160139 (iter: specialize Take::count using advance_by) - #160142 (bootstrap: remove use-lld config alias) - #160148 (Rename `errors.rs` file to `diagnostics.rs` (15/N)) - #160151 (Mark a doctest as requiring unwinding) - #160166 (Use correct feature gates for `f16`/`f128` `From` impls)
Merged
rust-bors Bot pushed a commit that referenced this pull request
Jul 30, 2026Rollup of 20 pull requests Successful merges: - #157669 (cfi: add diag mode support) - #158247 (hermit/fs: Return `unsupported()` instead of `from_raw_os_error(22)`) - #158649 (Hermit: fix `readdir()` ) - #158693 (Add type-check to offload intrinisc calls) - #159049 (Avoid ICE in From/TryFrom cast suggestion when encountering HRTBs) - #159411 ([rustdoc] Correctly handle output options with --show-coverage) - #160053 (test: add test suite for the 85681 issue) - #160087 (Add regression test for nested associated-type projection ICE) - #160090 (rustc_resolve: Further reduce mutability in resolver) - #160099 (Resolver: split module resolutions into local and external resolutions) - #160101 (Add missing `needs-unwind` annotation to `add-spawn-hook-reentrancy-159923` test) - #160106 (Add suggestions for `must_implement_one_of`) - #160117 (Remove unnecessary format usage) - #160134 (Work around Wine bug 60084 by calling WSAStartup at most once) - #160139 (iter: specialize Take::count using advance_by) - #160142 (bootstrap: remove use-lld config alias) - #160148 (Rename `errors.rs` file to `diagnostics.rs` (15/N)) - #160151 (Mark a doctest as requiring unwinding) - #160166 (Use correct feature gates for `f16`/`f128` `From` impls) - #160178 (Remove unused `va_start` intrinsic)
rust-bors Bot pushed a commit that referenced this pull request
Jul 30, 2026Rollup of 20 pull requests Successful merges: - #157669 (cfi: add diag mode support) - #158247 (hermit/fs: Return `unsupported()` instead of `from_raw_os_error(22)`) - #158649 (Hermit: fix `readdir()` ) - #158693 (Add type-check to offload intrinisc calls) - #159049 (Avoid ICE in From/TryFrom cast suggestion when encountering HRTBs) - #159411 ([rustdoc] Correctly handle output options with --show-coverage) - #160053 (test: add test suite for the 85681 issue) - #160087 (Add regression test for nested associated-type projection ICE) - #160090 (rustc_resolve: Further reduce mutability in resolver) - #160099 (Resolver: split module resolutions into local and external resolutions) - #160101 (Add missing `needs-unwind` annotation to `add-spawn-hook-reentrancy-159923` test) - #160106 (Add suggestions for `must_implement_one_of`) - #160117 (Remove unnecessary format usage) - #160134 (Work around Wine bug 60084 by calling WSAStartup at most once) - #160139 (iter: specialize Take::count using advance_by) - #160142 (bootstrap: remove use-lld config alias) - #160148 (Rename `errors.rs` file to `diagnostics.rs` (15/N)) - #160151 (Mark a doctest as requiring unwinding) - #160166 (Use correct feature gates for `f16`/`f128` `From` impls) - #160178 (Remove unused `va_start` intrinsic)
rust-timer added a commit that referenced this pull request
Jul 30, 2026Rollup merge of #160139 - Rachit2323:take-count-specialization, r=joboet iter: specialize Take::count using advance_by Right now, when you call .count() on a Take iterator, it visits every single item one by one just to count them. That's slow. For example, if you have 1000 items and call .take(5).count(), it should just skip 5 items and return 5 — but today it actually goes through each item manually. This PR fixes that by using advance_by to skip items in bulk instead of visiting each one. After the skip, we know exactly how many items were consumed, so we return that number directly. This makes .count() faster for Take iterators, especially when the underlying iterator supports fast skipping.