rust-lang / rust-lang/rustfmt

bug: rustfmt silently breaks on this sample

Open
#6,769 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-strings C-bug I-poor-formatting
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
2d 13h
Merged PRs (30d)
24

Description

For whatever reason I can't get rustfmt to do anything with this code:

let foo = [
        (b"Welcome to Ringboard!" as &[u8], &em),
        (
            b"Ringboard is a fast, efficient, and composable clipboard manager for Linux."
          ,  &em,
        ),
        (
           b"It supports both Wayland and X11 along with multiple clients to manage your \
             clipboard history."
   ,         &em,
        ),
        (
            b"Clients include a standard GUI, an interactive TUI, and a CLI for all your scripting \
             needs."
           , &em,
        ),
        (
            "Ringboard can copy arbitrary bytes—that includes images!".as_bytes(),
            &em,
        ),
        (
            b"Plaintext and RegEx search are available for fast entry retrieval.",
            &em,
        ),
        (b"Enjoy this image from our AI overlords:", &em),
        (
            include_bytes!("../logo.jpeg") as &[u8],
            &MimeType::from("image/jpeg").unwrap(),
        ),
        (
            b"Finally, it's worth mentioning that Ringboard is extremely efficient, performant, \
             and scalable."
           , &em,
        ),
    ];

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

Use the Rust sample in the issue as the reproduction case; first run rustfmt on it and capture the silent failure. Done means the sample's behavior and expected formatting outcome are established and rustfmt no longer fails silently.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.