Skip to content

rustdoc: unterminated string with inner attributes #99089

Closed
@ehuss

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

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