Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: unterminated string with inner attributes #99089

Closed
ehuss opened this issue Jul 9, 2022 · 0 comments · Fixed by #99142
Closed

rustdoc: unterminated string with inner attributes #99089

ehuss opened this issue Jul 9, 2022 · 0 comments · Fixed by #99142
Labels
A-doctests Area: Documentation tests, run by rustdoc C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@ehuss
Copy link
Contributor

ehuss commented Jul 9, 2022

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
@ehuss ehuss added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-bug Category: This is a bug. A-doctests Area: Documentation tests, run by rustdoc labels Jul 9, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Jul 11, 2022
…ne-crate-attributes, r=GuillaumeGomez

fix(doctest): treat fatal parse errors as incomplete attributes

Fixes rust-lang#99089
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 11, 2022
…ne-crate-attributes, r=GuillaumeGomez

fix(doctest): treat fatal parse errors as incomplete attributes

Fixes rust-lang#99089
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 11, 2022
…ne-crate-attributes, r=GuillaumeGomez

fix(doctest): treat fatal parse errors as incomplete attributes

Fixes rust-lang#99089
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 11, 2022
…ne-crate-attributes, r=GuillaumeGomez

fix(doctest): treat fatal parse errors as incomplete attributes

Fixes rust-lang#99089
@bors bors closed this as completed in 6c44357 Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-doctests Area: Documentation tests, run by rustdoc C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant