Skip to content

rustfmt changes code between stable and beta Β #6203

Closed as not planned
Closed as not planned
@Manishearth

Description

@Manishearth

With the following code:

fn main() {
    let arr = [
        ("en-001", "", "Hello from πŸ—ΊοΈ"),  // WORLD
        ("en-002", "", "Hello from 🌍"), // AFRICA
    ];
}

playground

rustfmt considers it correctly formatted under Rust 1.79, but will remove the space before // WORLD under Rust 1.80-beta3 (and nightly)

This is caused by unicode-width 0.1.13, which changed the predicted widths of a lot of Unicode characters, including emoji. The new version is more accurate, but these changes have not been made in a way that guarantees any kind of stability. The issue I have filed asks for such an API.

In the meantime, should rust/rustfmt pin to 0.1.2?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions