When running cargo clippy on the crate rs-graph (download source code from here) I get the following error:
% cargo clippy
Compiling rs-graph v0.6.3 (file:///home/me/test/rs-graph)
thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', /home/me/.cargo/registry/src/github.com-1ecc6299db9ec823/pulldown-cmark-0.0.15/src/scanners.rs:355:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.
thread 'main' panicked at 'rustc_thread failed: Any', /checkout/src/libcore/result.rs:860:4
error: Could not compile `rs-graph`.
To learn more, run the command again with --verbose.
So maybe it is a problem in pulldown-cmark, but since clippy is the only way for me to reproduce the error I raised the issue here.
rust version: rustc 1.21.0-nightly (dd53dd5f9 2017-08-01)
clippy: 0.0.148
This is both a bug in pulldown-cmark and clippy. I've sent a PR to pulldown-cmark, now we just have to fix the doc lint to correctly handle /** */ comments (especially with * prefixes) – and we should warn about it, you should really use /// comments.
Thanks a lot. If I understand correctly, then replacing all /** */ comments by /// comments should solve the problem for me, even with the current clippy version, is this correct? If so, then I'm running now into another problem (clippy panicking with some internal compiler error), but this should probably go into another bug report ...
For the record, rustdoc allows /** doc comments and even removes * prefixes. Clippy should do the latter, too.
Most helpful comment
This is both a bug in pulldown-cmark and clippy. I've sent a PR to pulldown-cmark, now we just have to fix the doc lint to correctly handle
/** */comments (especially with*prefixes) – and we should warn about it, you should really use///comments.