rust-lang / rust-lang/rust

Tracking Issue for WebAssembly exception handling

Open
#118,168 1 comment 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-tracking-issue
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

This is a tracking issue for wasm native exception handling, which would allow panic=unwind to function properly for code targeting wasm.

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

Steps
Unresolved Questions
  • -C target-feature=+exception-handling vs -C panic=unwind -- does one imply the other, or is one of them redundant?
    • panic=unwind should enable exception-handling
  • Should -C llvm-args=-wasm-enable-eh be passed by default on all wasm targets, to be stripped out if the exception-handling target feature is disabled?
    • yes: afaict -wasm-enable-eh does not affect codegen in general, only isel for the wasm.throw instruction.
  • Should exception-handling instructions (e.g. from prebuilt libstd) be stripped out if panic=abort? If so, by whom? wasm-ld? wasm-opt does currently implement a --strip-eh pass; maybe that's good enough if users want to target wasm MVP?
    • this problem is similar to the one that atomics (#77839) faces, of a single prebuilt libstd coming into conflict with some users needing backwards compatibility with wasm-MVP and others wanting to use more recently stabilized features
Implementation history
  • #111322
  • #121438

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

The issue names no source files or tests. Start by reading the linked WebAssembly exception-handling issues and the rustc-dev-guide stabilization and documentation guidance; completion means resolving the remaining LLVM support, documentation, stabilization, and panic=abort checklist items.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.