rust-lang / rust-lang/rust

`PanicInfo::can_unwind` doesn't take the panic strategy into account

Open
#156,093 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-triage
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Problem

PanicInfo::can_unwind always returns whether the panic handler is allowed to unwind based on the calling functions regardless of the panic strategy.

Proposed solution

Return false when the panic strategy is set to abort (or anything that doesn't unwind).

(sorry for using a freeform issue for this, i didn't know what else to use)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the implementation of PanicInfo::can_unwind and how it reads the current panic strategy. Verify the behavior for aborting and unwinding strategies, then update the relevant coverage so the result is false for non-unwinding strategies and remains true when unwinding is allowed.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.