Skip to content

rustdoc: attribute string literals render with backslashes #81482

Closed
@ehuss

Description

@ehuss

I tried this code:

#[must_use = "this is a \
              message"]
pub fn f() {}

I expected to see this happen: Rustdoc will render the string as #[must_use = "this is a message"]

Instead, this happened: It is rendered with a backslash:

image

Meta

rustdoc 1.51.0-nightly (f4eb5d9f7 2021-01-25)

I believe this started in 1.44 via #69686.

(This is a pretty minor issue, I'm not sure it is worth putting energy into, but it does look a little strange.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions