Repository navigation
Panic caused by Markdown in latest nightly #40918
Description
Activity
The problem is that this block:
/// A value is validated successfully if the
from_strmethod for the given
/// type returns successfully. Otherwise, the raw form value is returned as
/// theErrvalue.Is considered as code. I wonder what would be a good solution for this (because that's how correct markdown considers this)...
I don't think it should be...should it? It wasn't prior to this: https://api.rocket.rs/rocket/request/trait.FromFormValue.html#provided-implementations
Yes but before, hoedown wasn't really markdown compliant. You can see by yourself how your code is interpreted by the markdown here.
- addedT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools
on Mar 30, 2017 (not giving this all the tags because it's linked in to the tracking issue
rustc is panicking on markdown that previously parsed.
To be clear, this is a test failure, not an ICE, correct?
thread 'rustc' panicked at 'couldn't compile the test', /checkout/src/librustdoc/test.rs:270
that is, this is a test failure.
To be clear, this is a test failure, not an ICE, correct?
Yes.
Right. So this is more of expected breakages caused by a bugfix.
@SergioBenitez are you running off rustc master? I wasn't even aware this was in nightly yet, I thought it missed the cutoff. As I mentioned in the other issue, I was planning on publicizing this tomorrow.
@steveklabnik Looks like this made it into today's nightly.
Okay, so after discussing this a bit on IRC and playing with the
commonmark.jsscript, the issue stems from a difference in howhoedownandpulldown-cmarkinterpret text to be inside of a list item:Leading text: * List Item Heading This is considered to be part of the list item in `hoedown` but not `pulldown-cmark`. This is still inside the list item in `hoedown` but is a new code block in `pulldown-cmark`.
As shown above, text that
hoedowntreated as being inside of a list item is now treated bypulldown-cmarkto be a code block.rustdoctries to compile each code block as Rust code, and since this is clearly not Rust, compilation fails, and we see thepanic!from the failed compilation.While this isn't a bug in
rustc, it is a breaking change. I'd suggest that a crater run is done to catch any more of these and potentially notify the authors. Alternatively, some of these peculiarities can be "forward-ported" to the new parser.Huh. Well, better make that post for sure, I guess. (The nightly)
Crater wouldn't catch this, it doesn't run tests.
/// * **f32, f64, isize, i8, i16, i32, i64, usize, u8, u16, u32, u64** /// /// **IpAddr, Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6, SocketAddr** /// /// A value is validated successfully if the `from_str` method for the given /// type returns successfully. Otherwise, the raw form value is returned as /// the `Err` value.Should work. The prior behaviour seems like a bug to me even considering the original markdown, and I think this is not easily fixable without making the markdown parser non-compliant.
I'm giving this one a close since it's expected behavior. Thanks all!
rustcis panicking on markdown that previously parsed. This appears to be caused by the transition from hoedown to pulldown-cmark (#40912, #40338):The markdown being referenced in the error looks like this:
cc @steveklabnik @GuillaumeGomez