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.
Update cargo
5 commits in 1e8703890f285befb5e32627ad4e0a0454dde1fb..3c44c3c4b7900b8b13c85ead25ccaa8abb7d8989
2021-03-26 16:59:39 +0000 to 2021-03-31 21:21:15 +0000
- Fix semver docs for 1.51. (rust-lang/cargo#9316)
- Add `cargo config` subcommand. (rust-lang/cargo#9302)
- Give one more example for the --featuers CLI (rust-lang/cargo#9313)
- Bump to 0.54.0, update changelog (rust-lang/cargo#9308)
- Make the URL to the tracking issue for `--out-dir` into a link (rust-lang/cargo#9309)
Rollup of 5 pull requests
Successful merges:
- #83015 (Add regression tests for #79825 and #81555)
- #83699 (Add a regression test for issue-68830)
- #83700 (Fix documentation of conversion from String to OsString)
- #83711 (Clarify `--print target-list` is a rustc's option)
- #83712 (Update LLVM with another wasm simd fix)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Refactor `Binder` to track bound vars
c.c. `@rust-lang/wg-traits`
This is super early (and might just get closed at some point), but want to get at least an initial idea of the perf impact.
r? `@ghost`
rustdoc: Only look at blanket impls in `get_blanket_impls`
The idea here is that all the work in 16156fb278/compiler/rustc_middle/src/ty/trait_def.rs (L172-L186) doesn't matter for `get_blanket_impls` - Rustdoc will already pick up on those blocks when it documents the item.
Run LLVM coverage instrumentation passes before optimization passes
This matches the behavior of Clang and allows us to remove several
hacks which were needed to ensure functions weren't optimized away
before reaching the instrumentation pass.
Fixes#83429
cc `@richkadel`
r? `@tmandry`
Rollup of 6 pull requests
Successful merges:
- #80720 (Make documentation of which items the prelude exports more readable.)
- #83654 (Do not emit a suggestion that causes the E0632 error)
- #83671 (Add a regression test for issue-75801)
- #83678 (Fix Self keyword doc URL conflict on case insensitive file systems (until definitely fixed on rustdoc))
- #83680 (Update for loop desugaring docs)
- #83683 (bootstrap: don't complain about linkcheck if it is excluded)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
bootstrap: don't complain about linkcheck if it is excluded
We don't need to complain to the user about linkcheck having different
hosts and targets when it is already excluded.
Resolves#83661
Disallow octal format in Ipv4 string
In its original specification, leading zero in Ipv4 string is interpreted
as octal literals. So a IP address 0127.0.0.1 actually means 87.0.0.1.
This confusion can lead to many security vulnerabilities. Therefore, in
[IETF RFC 6943], it suggests to disallow octal/hexadecimal format in Ipv4
string all together.
Existing implementation already disallows hexadecimal numbers. This commit
makes Parser reject octal numbers.
Fixes#83648.
[IETF RFC 6943]: https://tools.ietf.org/html/rfc6943#section-3.1.1
We don't need to complain to the user about linkcheck having different
hosts and targets when it is already excluded. This can be achieved by
moving the check to when the step is run instead of in should_run.