Skip to content

rustdoc: unterminated string with inner attributes #99089

Closed

Description

@ehuss

When an inner attribute has a string which spans multiple lines, rustdoc --test will complain about it being unterminated.

I tried this code:

/// ```
/// #![deprecated(since = "5.2", note = "foo was rarely used. \
///    Users should instead use bar")]
/// ```
pub fn f() {}

(Note: The backslash doesn't matter.)

I expected to see this happen: rustdoc --test should run successfully.

Instead, this happened: rustdoc --test fails with:

running 1 test
error[E0765]: unterminated double quote string

test a.rs - f (line 1) ... FAILED

failures:

failures:
    a.rs - f (line 1)

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

Meta

rustc --version --verbose:

rustc 1.64.0-nightly (06754d885 2022-07-08)
binary: rustc
commit-hash: 06754d8852bea286a3a76d373ccd17e66afb5a8b
commit-date: 2022-07-08
host: x86_64-apple-darwin
release: 1.64.0-nightly
LLVM version: 14.0.6

Activity

  1. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    A-doctestsArea: Documentation tests, run by rustdoc
    on Jul 9, 2022
  2. added a commit that references this issue on Jul 11, 2022
    6c44357
  3. added a commit that references this issue on Jul 11, 2022
    18a2fa7
  4. added 3 commits that reference this issue on Jul 11, 2022
    b16819d
    3935853
    24d241a
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

    A-doctestsArea: Documentation tests, run by rustdocC-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