Skip to content

Stop carrying bodyless Rust declarations into the next impl #866

Closed

Description

@LunaStev

Problem

The spacing helper treated a semicolon-terminated trait function declaration as an unfinished function and carried it into the following impl, producing spacing that disagreed with rustfmt.

Reproduction

At the pre-fix formatter, feed a trait containing fn run(); followed by impl Trait for Type. Check function_ranges/add_function_spacing. PR #860 clears bodyless declarations on their terminating semicolon; smoke checks cover this case and idempotence.

Implementation status: Already implemented in open PR #860. This issue restores missing tracking; do not duplicate the implementation. Review and final PR validation remain with that PR.

Completion criteria

  • Recognize bodyless trait/extern declarations without borrowing a later body.
  • Keep formatting idempotent and consistent with rustfmt.

Activity

  1. self-assigned this
    on Oct 7, 2026
  2. added
    bugA problem that causes incorrect behavior or crashes.
    ready for reviewThe pull request or issue is ready for review.
    on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugA problem that causes incorrect behavior or crashes.ready for reviewThe pull request or issue is ready for review.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions