-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
[Hoedown comeback regression] Code in doc not tested with future warning, when it was always a test in the past #41401
Comments
Interesting; it is parsed as two separate blocks by CommonMark: http://spec.commonmark.org/dingus/?text=%60%60%60%0Aassert!(true)%3B%0A%60%60%60%0A%0A%60%60%60%0Aassert!(true)%3B%0A%60%60%60 Hoedown is not on https://johnmacfarlane.net/babelmark2/?text=%60%60%60%0Aassert!(true)%3B%0A%60%60%60%0A%0A%60%60%60%0Aassert!(true)%3B%0A%60%60%60 but it looks like mostly trivial variations |
@steveklabnik It is rendered as two separate blocks in Hoedown (in stable). It is just that rustdoc now becomes too conservative in classifying code blocks as tests. |
@kennytm yes, sorry. It looks like this is a hoedown bug; @GuillaumeGomez is on the case |
Problem comes from the fact that hoedown gives an invalid line number so I have to fix code we want to remove. T_T |
Anyone know a workaround for this? Are there any magic changes I can make to my doc comment for now to get both blocks to run? |
@dtolnay You could add an explicit paragraph break between the code blocks e.g. /// ```
/// assert!(true);
/// ```
///
/// <!-- -->
///
/// ```
/// assert!(true);
/// ```
But I'd just wait for the next nightly which has this bug fixed. |
Additional test cases:
See #41405 (comment) for details. |
includes a workaround for rust-lang/rust#41401
…ovement, r=steveklabnik Fix line display for hoedown Fixes rust-lang#41401. r? @rust-lang/docs
…ovement, r=steveklabnik Fix line display for hoedown Fixes rust-lang#41401. r? @rust-lang/docs
Test case:
Expected: when running
cargo test
, it will run two doctests (as in stable and beta).Actual: Only the first doctest is run, the second one is skipped, with this warning:
Real life test case:
(cc @GuillaumeGomez #41290)
No warnings in this version:
Have warnings in this version:
The text was updated successfully, but these errors were encountered: