rust/library
许杰友 Jieyou Xu (Joe) 01bc95417c
Rollup merge of #138329 - scottmcm:assert-hint, r=Mark-Simulacrum
debug-assert that the size_hint is well-formed in `collect`

Closes #137919

In the hopes of helping to catch any future accidentally-incorrect rustc or stdlib iterators (like the ones #137908 accidentally found), this has `Iterator::collect` call `size_hint` and check its `low` doesn't exceed its `Some(high)`.

There's of course a bazillion more places this *could* be checked, but the hope is that this one is a good tradeoff of being likely to catch lots of things while having minimal maintenance cost (especially compared to putting it in *every* container's `from_iter`).
2025-03-16 09:40:07 +08:00
..
alloc Rollup merge of #138303 - DiuDiu777:rc-fix, r=Mark-Simulacrum 2025-03-16 09:40:06 +08:00
alloctests Add comments 2025-03-07 19:11:13 +00:00
backtrace@9d2c34e7e6 Update backtrace 2025-02-13 14:32:50 -08:00
core Rollup merge of #138329 - scottmcm:assert-hint, r=Mark-Simulacrum 2025-03-16 09:40:07 +08:00
coretests Update tests. 2025-03-10 12:20:05 +01:00
panic_abort Migrate panic_abort to Rust 2024 2025-03-11 09:46:34 -07:00
panic_unwind Migrate panic_unwind to Rust 2024 2025-03-11 09:46:34 -07:00
portable-simd Remove ignored #[must_use] attributes from portable-simd 2025-02-12 13:59:22 +01:00
proc_macro Migrate proc_macro to Rust 2024 2025-03-11 09:46:34 -07:00
profiler_builtins Migrate profiler_builtins to Rust 2024 2025-03-11 09:46:35 -07:00
rtstartup Mark extern blocks as unsafe 2025-02-09 17:11:13 +00:00
rustc-std-workspace-alloc Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
rustc-std-workspace-core Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
rustc-std-workspace-std Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
std Rollup merge of #138275 - folkertdev:expose-is-s390x-feature-detected, r=Mark-Simulacrum 2025-03-16 09:40:05 +08:00
stdarch@9426bb5658 Update stdarch 2025-03-06 11:11:55 -08:00
sysroot Migrate the sysroot crate to Rust 2024 2025-03-11 09:46:35 -07:00
test Migrate test to Rust 2024 2025-03-11 09:46:34 -07:00
unwind Rollup merge of #138162 - ehuss:library-2024, r=cuviper 2025-03-13 10:58:21 +01:00
windows_targets Migrate windows-targets to Rust 2024 2025-03-11 09:46:35 -07:00
Cargo.lock Rollup merge of #138356 - betrusted-io:bump-libc-0.2.171, r=jhpratt 2025-03-13 11:28:33 +01:00
Cargo.toml Move all alloc integration tests to a new alloctests crate 2025-03-07 19:11:11 +00:00