Skip to content

Style Guide prescriptions on ABI explicitness #199

@calebcartwright

Description

@calebcartwright
Member

rust-lang/rfcs#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. rust-lang/rustfmt#2908)

Once rust-lang/rfcs#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

Activity

traviscross

traviscross commented on Apr 16, 2025

@traviscross

I propose we adopt @calebcartwright's proposal that:

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

Included in this is that if there's not an ABI at all in the AST, the formatter should not add one.

On the matter of what prescriptions we should make in older editions about whether to add an ABI, I'd propose that the style guide can simply be silent about this since we now have a lang side lint in all editions against extern without an ABI, and we don't need to speak on the style side to things that are already handled via warning-level lang lints.

@rfcbot fcp merge

rfcbot

rfcbot commented on Apr 16, 2025

@rfcbot

Team member @traviscross has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

rfcbot

rfcbot commented on Apr 16, 2025

@rfcbot

🔔 This is now entering its final comment period, as per the review above. 🔔

psst @traviscross, I wasn't able to add the final-comment-period label, please do so.

calebcartwright

calebcartwright commented on Apr 17, 2025

@calebcartwright
MemberAuthor

Remind me, will the current process require 2 checkboxes or will it enter the final comment period as soon as any one person has checked their box?

Edit: never mind, I remember what we talked about on this topic when the team first changed to three members

rfcbot

rfcbot commented on Apr 26, 2025

@rfcbot

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

psst @traviscross, I wasn't able to add the finished-final-comment-period label, please do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @traviscross@calebcartwright@rfcbot

        Issue actions

          Style Guide prescriptions on ABI explicitness · Issue #199 · rust-lang/style-team