Skip to content

Simplify the unwind crate#159010

Merged
rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
bjorn3:refactor_unwind
Jul 19, 2026
Merged

Simplify the unwind crate#159010
rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
bjorn3:refactor_unwind

Conversation

@bjorn3

@bjorn3 bjorn3 commented Jul 9, 2026

Copy link
Copy Markdown
Member

View all comments

Use cfg_select! and unify type definitions.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 9, 2026
@rustbot

rustbot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 12 candidates
  • Random selection from 6 candidates

@bjorn3

bjorn3 commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

@xobs would you be able to check if the second commit doesn't break Xous?

@rust-log-analyzer

This comment has been minimized.

@bjorn3
bjorn3 force-pushed the refactor_unwind branch from 3581b47 to 4866a9c Compare July 9, 2026 14:46
@rustbot

rustbot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

miri is developed in its own repository. If possible, consider making this change to rust-lang/miri instead.

cc @rust-lang/miri

Comment thread library/unwind/src/libunwind.rs Outdated
@bjorn3
bjorn3 force-pushed the refactor_unwind branch from 13a879b to 9cd0685 Compare July 10, 2026 12:51
@rust-log-analyzer

This comment has been minimized.

@bjorn3
bjorn3 force-pushed the refactor_unwind branch from 9cd0685 to 407410c Compare July 10, 2026 13:43
@xobs

xobs commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

At first blush, it doesn't compile:

Compiling panic_unwind v0.0.0 (/Users/seancross/Code/Xous/rust/library/panic_unwind)
warning: dropping unsupported crate type `dylib` for target `riscv32imac-unknown-xous-elf`

error[E0433]: cannot find `FrameInfoKind` in `unwind`
  --> std/src/sys/pal/xous/mod.rs:23:35
   |
23 |                     kind: unwind::FrameInfoKind::EhFrame(unsafe { EH_FRAME_ADDRESS }),
   |                                   ^^^^^^^^^^^^^ could not find `FrameInfoKind` in `unwind`

error[E0405]: cannot find trait `EhFrameFinder` in crate `unwind`
  --> std/src/sys/pal/xous/mod.rs:16:25
   |
16 |     unsafe impl unwind::EhFrameFinder for EhFrameFinder {
   |                         ^^^^^^^^^^^^^ not found in `unwind`

error[E0425]: cannot find type `FrameInfo` in crate `unwind`
  --> std/src/sys/pal/xous/mod.rs:17:54
   |
17 |         fn find(&self, _pc: usize) -> Option<unwind::FrameInfo> {
   |                                                      ^^^^^^^^^ not found in `unwind`

error[E0422]: cannot find struct, variant or union type `FrameInfo` in crate `unwind`
  --> std/src/sys/pal/xous/mod.rs:21:30
   |
21 |                 Some(unwind::FrameInfo {
   |                              ^^^^^^^^^ not found in `unwind`

error[E0425]: cannot find function `set_custom_eh_frame_finder` in crate `unwind`
  --> std/src/sys/pal/xous/mod.rs:48:21
   |
48 |             unwind::set_custom_eh_frame_finder(&super::eh_unwinding::EH_FRAME_SETTINGS).ok();
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `unwind`

Some errors have detailed explanations: E0405, E0422, E0425, E0433.
For more information about an error, try `rustc --explain E0405`.

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@rustbot author

r=me on the general approach once we get xous working -- I'd expect you can check at least compilation locally with x.py check? You might need to skip bootstrap's sanity checks for a c toolchain.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 11, 2026
@bjorn3

bjorn3 commented Jul 12, 2026

Copy link
Copy Markdown
Member Author

./x.py check --target riscv32imac-unknown-xous-elf library now passes minus pre-existing implicit_provenance_casts lint violations.

@bors r=Mark-Simulacrum

@rust-bors

rust-bors Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 64811e9 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 12, 2026
@bjorn3

bjorn3 commented Jul 12, 2026

Copy link
Copy Markdown
Member Author

Opened #159174 for the lint warnings.

jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 12, 2026
…ulacrum

Simplify the unwind crate

Use cfg_select! and unify type definitions.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 12, 2026
…ulacrum

Simplify the unwind crate

Use cfg_select! and unify type definitions.
rust-bors Bot pushed a commit that referenced this pull request Jul 12, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #158732 (Apply MCP 1003 and move diagnostics.rs into its own module)
 - #159010 (Simplify the unwind crate)
 - #159131 (bootstrap: Allow path-based skipping of the coverage test suite)
 - #159134 (std: fix panic in Windows Stdin::read_vectored with pending surrogate)
 - #159178 (Print duration of BOLT instrumentation and optimization steps)
 - #159112 (Fix segfault in env access in statically linked FreeBSD binaries)
 - #159124 (compiletest: use VecDeque::pop_front_if)
@JonathanBrouwer

Copy link
Copy Markdown
Contributor

💔 I suspect this PR failed tests as part of a rollup
@bors r-

After fixing the problem, consider running a try job for the failed job before re-approving.

Link to failure: #159187 (comment)

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 12, 2026
@rust-bors

rust-bors Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#159187), which was unapproved.

View changes since this unapproval

@bjorn3
bjorn3 force-pushed the refactor_unwind branch from 64811e9 to aa31851 Compare July 13, 2026 10:14
@bjorn3

bjorn3 commented Jul 13, 2026

Copy link
Copy Markdown
Member Author

I've reverted the unwinder_private_data_size and _Unwind_Exception.private visibility changes. Turns out EHABI on ARM does genuinely require the personality function to touch the private field.

@bjorn3 bjorn3 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 13, 2026
@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r+ rollup=iffy

@bors try jobs=dist-various*,

@rust-bors

rust-bors Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

📌 Commit aa31851 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 18, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 18, 2026
Simplify the unwind crate


try-job: dist-various*
try-job:
@rust-bors

rust-bors Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: b85baf3 (b85baf3d9ce33e9e6f6c8a78d0ae3ff58ce140b8)
Base parent: b26c8ef (b26c8ef0535b2de24a0af4048370caf449eebabd)

rust-bors Bot pushed a commit that referenced this pull request Jul 18, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #159517 (stdarch subtree update)
 - #159010 (Simplify the unwind crate)
 - #156650 (Stop using prefix_tys)
 - #159152 (triagebot: cc miri on any special-casing of miri in the standard library)
 - #159522 (Apply `#[diagnostic::opaque]` to macros expanding to built-in syntax)
 - #159528 (implement `const_binary_search`)
@rust-bors
rust-bors Bot merged commit 03d7528 into rust-lang:main Jul 19, 2026
14 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 19, 2026
rust-timer added a commit that referenced this pull request Jul 19, 2026
Rollup merge of #159010 - bjorn3:refactor_unwind, r=Mark-Simulacrum

Simplify the unwind crate

Use cfg_select! and unify type definitions.
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Jul 19, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#159517 (stdarch subtree update)
 - rust-lang/rust#159010 (Simplify the unwind crate)
 - rust-lang/rust#156650 (Stop using prefix_tys)
 - rust-lang/rust#159152 (triagebot: cc miri on any special-casing of miri in the standard library)
 - rust-lang/rust#159522 (Apply `#[diagnostic::opaque]` to macros expanding to built-in syntax)
 - rust-lang/rust#159528 (implement `const_binary_search`)
@bjorn3
bjorn3 deleted the refactor_unwind branch July 19, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants