-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Rollup of 6 pull requests #147158
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
Closed
Closed
Rollup of 6 pull requests #147158
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…meters Several functions had comments referencing a non-existent `valid` parameter. Remove those. The `guar` parameter that handles errors is already documented. In the process, remove another duplicate reference to an already-documented parameter (`binders`).
…default The linux backtrace unwinder relies on unwind tables to work properly, and generating and printing a backtrace is done by for example the default panic hook. Begin emitting unwind tables by default again with `-C panic=abort` (see history below) so that backtraces work. History ======= Backtraces with `-C panic=abort` used to work in Rust 1.22 but broke in Rust 1.23, because in 1.23 we stopped emitting unwind tables with `-C panic=abort` (see 24cc38e). In 1.45 (see cda9946) a workaround in the form of `-C force-unwind-tables=yes` was added. `-C panic=abort` was added in [Rust 1.10](https://blog.rust-lang.org/2016/07/07/Rust-1.10/#what-s-in-1-10-stable) and the motivation was binary size and compile time. But given how confusing that behavior has turned out to be, it is better to make binary size optimization opt-in with `-C force-unwind-tables=no` rather than default since the current default breaks backtraces. Besides, if binary size is a primary concern, there are many other tricks that can be used that has a higher impact.
This emits the same attributes we place on allocator declarations (and allocator definitions using `#[global_allocator]`) on the definitions in the allocator shim as well, making sure that the attributes are not lost if the allocator shim participates in LTO.
…trochenkov Fix backtraces with `-C panic=abort` on linux; emit unwind tables by default The linux backtrace unwinder relies on unwind tables to work properly, and generating and printing a backtrace is done by for example the default panic hook. Begin emitting unwind tables by default again with `-C panic=abort` (see history below) so that backtraces work. Closes rust-lang#81902 which is **regression-from-stable-to-stable** Closes rust-lang#94815 ### History Backtraces with `-C panic=abort` used to work in Rust 1.22 but broke in Rust 1.23, because in 1.23 we stopped emitting unwind tables with `-C panic=abort` (see rust-lang#45031 and rust-lang#81902 (comment)). In 1.45 a workaround in the form of `-C force-unwind-tables=yes` was added (see rust-lang#69984). `-C panic=abort` was added in [Rust 1.10](https://blog.rust-lang.org/2016/07/07/Rust-1.10/#what-s-in-1-10-stable) and the motivation was binary size and compile time. But given how confusing that behavior has turned out to be, it is better to make binary size optimization opt-in with `-C force-unwind-tables=no` rather than default since the current default breaks backtraces. Besides, if binary size is a primary concern, there are many other tricks that can be used that has a higher impact. # Release Note Entry Draft: ## Compatibility Notes * [Fix backtraces with `-C panic=abort` on Linux by generating unwind tables by default](rust-lang#143613). Build with `-C force-unwind-tables=no` to keep omitting unwind tables.
std: implement `hostname` Resolves rust-lang/libs-team#330 Tracking issue: rust-lang#135142 This is based on rust-lang#135141, but I've reimplemented the UNIX version, which now: * uses `sysconf(_SC_HOST_NAME_MAX)` as an initial buffer length * returns `OutOfMemory` if the `Vec` allocation fails * retries the operation if it detects that the name returned by `gethostname` was truncated Additionally, as part of the rebase, I had to move some WinSock abstractions (initialisation and error access) to `sys::pal` so that they can be accessed from `sys::net::hostname`. CC `@orowith2os` (and thank you for your work!)
…etrochenkov mbe: macro_check: Fix function comments referencing non-existent parameters Several functions had comments referencing a non-existent `valid` parameter. Remove those. The `guar` parameter that handles errors is already documented. In the process, remove another duplicate reference to an already-documented parameter (`binders`).
Use MirPatch in simplify_branches. This allows to avoid clearing the CFG cache if we don't perform any change. r? `@ghost` for perf
…_from_attrs, r=lolbinarycat Remove one loop in `extract_cfg_from_attrs` Follow-up of rust-lang#138907. r? lolbinarycat
Emit allocator attributes for allocator shim This emits the same attributes we place on allocator declarations on the definitions in the allocator shim as well. This complements rust-lang#146766, which added the attribute for `#[global_allocator]` definitions. Emitting the attributes on the definitions ensures that they cannot be lost of the allocator shim participates in LTO. See rust-lang#145995 for context, though that one was about `#[global_allocator]`. I'm not sure whether this can occur with the allocator shim as well or not, but better safe than sorry. I'm not sure whether there is any good way to test this, as the allocator shim is not part of `--emit=llvm-ir`. I've verified this locally by inspecting the bitcode produced by `-C save-temps`. r? `@bjorn3`
@bors r+ rollup=never p=5 |
bors
added a commit
that referenced
this pull request
Sep 29, 2025
Rollup of 6 pull requests Successful merges: - #143613 (Fix backtraces with `-C panic=abort` on linux; emit unwind tables by default) - #146937 (std: implement `hostname`) - #147040 (mbe: macro_check: Fix function comments referencing non-existent parameters) - #147131 (Use MirPatch in simplify_branches.) - #147133 (Remove one loop in `extract_cfg_from_attrs`) - #147150 (Emit allocator attributes for allocator shim) r? `@ghost` `@rustbot` modify labels: rollup
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
A-run-make
Area: port run-make Makefiles to rmake.rs
O-windows
Operating system: Windows
rollup
A PR which is a rollup
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Successful merges:
-C panic=abort
on linux; emit unwind tables by default #143613 (Fix backtraces with-C panic=abort
on linux; emit unwind tables by default)hostname
#146937 (std: implementhostname
)extract_cfg_from_attrs
#147133 (Remove one loop inextract_cfg_from_attrs
)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup