Skip to content

rustdoc: attribute string literals render with backslashes #81482

Closed

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.)

Activity

  1. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    on Jan 28, 2021
  2. added 2 commits that reference this issue on Jun 14, 2021
  3. added a commit that references this issue on Jun 15, 2021
  4. added a commit that references this issue on Apr 3, 2022
    5925c8e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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