rust-lang / rust-lang/rustc_public

Abi enum is not very "stable"

Open
#18 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
125
Forks
19
PR merge metrics
No merged PRs in 30d

Description

We have this huge enum that exhaustively encodes all ABIs that Rust somehow (unstably or stably) supports. Any new ABI that gets added, will be a SMIR breaking change, even if no one really cares about more than like 3 specific ones.

We could do one of the following:

  • make the enum non-exhaustive, thus making adding new variants easy, and removing variants will just leave an unused variant around (that we could deprecate)
  • replace the enum by a struct Abi { name: String, unwind: bool } that can't be matched on exhaustively, and needs string matching.
  • do the struct thing above, but still have an enum for the name that allows at least matching on stable ABIs like Rust and C.

Contributor guide

No contributing guide indexed for this repository

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 reading the ABI enum in compiler/rustc_smir/src/stable_mir/ty.rs around line 154 and review how external tools consume it. Compare the proposed representations with the project's stability requirements; done means adding or removing ABI support no longer unnecessarily breaks SMIR while preserving the required matching behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.