Closed
Description
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)
Activity
Alexendoo commentedon Jan 13, 2022
bisects to 89b9f7b, likely #92357
camelid commentedon Jan 14, 2022
cc @GuillaumeGomez
camelid commentedon Jan 14, 2022
The docs for the MCVE render with an itemized bullet at the top of the page on nightly, but not on stable. I think this is why replacing the
/**
with///
makes the error go away: the*
is interpreted as part of the docs, so it triggers the indented text to be treated as a code block (it seems there must be preceding text to trigger the code block formatting).camelid commentedon Jan 14, 2022
It seems like
/** */
comments are completely broken:I still don't understand how that change could've cause this though; the particular code removed was related to trimming whitespace, not asterisks. Must be a strange cross-interaction.
[-]Nightly rust mistakes comment for doctest[/-][+]regression: rustdoc interprets the `*` in `/** */` doc comments as literal Markdown[/+]15 remaining items