Skip to content

regression: rustdoc interprets the * in /** */ doc comments as literal Markdown #92872

Closed
@dalcde

Description

@dalcde

Code

I tried this code:

/**
 *     a
 */
pub fn foo() {}

When I run cargo test, I get

running 0 tests

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


running 1 test
test src/lib.rs - foo (line 1) ... FAILED

failures:

---- src/lib.rs - foo (line 1) stdout ----
error[E0425]: cannot find value `a` in this scope
 --> src/lib.rs:2:1
  |
3 | a
  | ^ not found in this scope

error: aborting due to previous error

For more information about this error, try `rustc --explain E0425`.
Couldn't compile the test.

failures:
    src/lib.rs - foo (line 1)

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

Oddly it doesn't fail with /** replaced by ///.

This worked on rust version 1.60.0-nightly (092e1c9d2 2022-01-09) but failed on rust version 1.60.0-nightly (1409c015b 2022-01-11)

Metadata

Metadata

Labels

A-markdown-parsingArea: Markdown parsing for doc-commentsC-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions