rust/library
bors 803ddb8359 Auto merge of #83726 - the8472:large-trustedlen-fail-fast, r=kennytm
panic early when `TrustedLen` indicates a `length > usize::MAX`

Changes `TrustedLen` specializations to immediately panic when `size_hint().1 == None`.

As far as I can tell this is ~not a change~ a minimal change in observable behavior for anything except ZSTs because the fallback path would go through `extend_desugared()` which tries to `reserve(lower_bound)` which already is `usize::MAX` and that would also lead to a panic. Before it might have popped somewhere between zero and a few elements from the iterator before panicking while it now panics immediately.

Overall this should reduce codegen by eliminating the fallback paths.

While looking into the `with_capacity()` behavior I also noticed that its documentation didn't have a *Panics* section, so I added that.
2021-04-01 07:55:00 +00:00
..
alloc panic early when TrustedLen indicates a length > usize::MAX 2021-03-31 23:09:28 +02:00
backtrace@af078ecc0b std: Update the backtrace crate submodule 2020-11-20 11:56:07 -08:00
core Rollup merge of #83579 - RalfJung:ptr-arithmetic, r=dtolnay 2021-03-30 11:34:26 +02:00
panic_abort Add license metadata for std dependencies 2021-02-21 13:36:18 -05:00
panic_unwind Revert "Revert stabilizing integer::BITS." 2021-03-24 22:34:36 +01:00
proc_macro impl PartialEq<Punct> for char; symmetry for #78636 2021-02-19 17:28:19 -08:00
profiler_builtins Update the minimum external LLVM to 10 2021-03-22 11:33:43 -07:00
rtstartup Bump bootstrap compiler to 1.50 beta 2020-12-30 09:27:19 -05:00
rustc-std-workspace-alloc mv std libs to library/ 2020-07-27 19:51:13 -05:00
rustc-std-workspace-core Fix rustc-std-workspace-core documentation 2020-12-20 15:23:21 +08:00
rustc-std-workspace-std mv std libs to library/ 2020-07-27 19:51:13 -05:00
std Apply suggestions from code review 2021-03-31 16:09:25 +02:00
stdarch@9c732a56f6 Update stdarch submodule 2020-12-21 00:00:00 +00:00
term Allow/fix non_fmt_panic in tests. 2021-02-03 23:15:45 +01:00
test lazily calls some fns 2021-03-27 10:20:32 +03:00
unwind Rollup merge of #82374 - clehner:licenses, r=joshtriplett 2021-03-22 15:21:23 +01:00