Skip to content

"left behind trailing whitespace" error in enum with casts #3741

@Seeker14491

Description

@Seeker14491

Attempting to format the following:

pub enum PublishedFileVisibility {
    Public = sys::ERemoteStoragePublishedFileVisibility_k_ERemoteStoragePublishedFileVisibilityPublic as i32,
    FriendsOnly = sys::ERemoteStoragePublishedFileVisibility_k_ERemoteStoragePublishedFileVisibilityFriendsOnly as i32,
    Private = sys::ERemoteStoragePublishedFileVisibility_k_ERemoteStoragePublishedFileVisibilityPrivate as i32,
}

produces this error:

error[internal]: left behind trailing whitespace
 --> /playground/src/main.rs:2:2:0
  |
2 |     
  | ^^^^
  |

warning: rustfmt has failed to format. See previous 1 errors.

Playground

This is the same testcase from #3562, but with as i32 appended to each variant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPanic, non-idempotency, invalid code, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions