rust-lang / rust-lang/rust

Style Guide prescriptions on ABI explicitness

Open
#152,760 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

E-help-wanted finished-final-comment-period I-style-radar T-style
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

https://github.com/rust-lang/rfcs/pull/3722 seems likely to land albeit for some future edition beyond 2024, and when it does I would propose we remove the existing ABI prescriptions from the Style Guide text

Formatters (at least rustfmt) do not necessarily have the relevant context to know whether formatting changes that involved the ABI would be semantics preserving, and the behavior that matched the "always be explicit" rule in the Style Guide did cause a couple of issues over the years (e.g. https://github.com/rust-lang/rustfmt/issues/2908)

Once https://github.com/rust-lang/rfcs/pull/3722 is enacted I think rustfmt should fallback to just maintaining ABI as it exists within the AST, and leave the consideration of whether an ABI has a default and/or is required as a lang item

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

Read the Style Guide's extern-items ABI section and track RFC 3722, then review rustfmt issue #2908 for the motivating behavior. Once the RFC is enacted, update the Style Guide's ABI prescriptions and verify the resulting formatting behavior preserves ABI as represented in the AST.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.