-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
alloc: Document panics when allocations will exceed max #148662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment has been minimized.
This comment has been minimized.
|
At a glance, the build failures appear to be related to CI setup and not to these changes. |
|
CI is currently broken, it should be fixed once #148665 is merged. |
7528a5b to
7c84655
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thank you!
library/alloc/src/string.rs
Outdated
| /// | ||
| /// # Panics | ||
| /// | ||
| /// Panics if the new capacity exceeds `isize::MAX` _bytes_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There isn't an old capacity here.
| /// Panics if the new capacity exceeds `isize::MAX` _bytes_. | |
| /// Panics if the capacity exceeds `isize::MAX` _bytes_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do prefer the suggested wording. Presently, Vec uses the "new capacity" phrasing; should I adjust that as well?
7c84655 to
5a8cf33
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Sorry for the delay, this looks fine! |
Rollup of 11 pull requests Successful merges: - #148662 (alloc: Document panics when allocations will exceed max) - #148811 (core docs: rewrite `panic::Location::caller` with visual line/column numbers) - #149101 (Improve mutable-binding suggestion to include name) - #149477 (float::maximum/minimum: make docs more streamlined) - #149547 (library: Rename `IterRange*` to `Range*Iter`) - #149548 (Generate delegation error body when delegation is not resolved) - #149630 (Check identifiers defined in macros when suggesting identifiers hidden by hygiene) - #149647 (Add regression test for 141845) - #149661 (Fix for LLVM22 making lowering decisions dependent on RuntimeLibraryInfo.) - #149666 (Add perma-unstable `--print=backend-has-zstd` for use by compiletest) - #149671 (interpret: test SNaN handling of float min/max and update comments) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 11 pull requests Successful merges: - rust-lang/rust#148662 (alloc: Document panics when allocations will exceed max) - rust-lang/rust#148811 (core docs: rewrite `panic::Location::caller` with visual line/column numbers) - rust-lang/rust#149101 (Improve mutable-binding suggestion to include name) - rust-lang/rust#149477 (float::maximum/minimum: make docs more streamlined) - rust-lang/rust#149547 (library: Rename `IterRange*` to `Range*Iter`) - rust-lang/rust#149548 (Generate delegation error body when delegation is not resolved) - rust-lang/rust#149630 (Check identifiers defined in macros when suggesting identifiers hidden by hygiene) - rust-lang/rust#149647 (Add regression test for 141845) - rust-lang/rust#149661 (Fix for LLVM22 making lowering decisions dependent on RuntimeLibraryInfo.) - rust-lang/rust#149666 (Add perma-unstable `--print=backend-has-zstd` for use by compiletest) - rust-lang/rust#149671 (interpret: test SNaN handling of float min/max and update comments) r? `@ghost` `@rustbot` modify labels: rollup
Document panics in
StringandVecdue to capacity overflowingisize::MAX. Correct outdated claims ofusize::MAXlimit.Fixes #148598.
Ping @lolbinarycat