Skip to content

String Debug implementation prints escaped single quotes #83046

Closed
@marcianx

Description

@marcianx

This is very minor.

println!("{:?}", "'");

(playground)

Expected output: "'"
Actual output: "\'"

Perhaps this was intentional, but I'm not sure why it would be. The closest issue I saw was #3752 which is ancient and was more obviously a bug since escapes were appearing in Display output and not just Debug.

This reproduces in the latest stable (1.50.0) and nightly (1.52.0-nightly) builds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions