You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the following as module level or item level doc test (module level shown in example) ...
//! ```test_harness,norun
//! # // This is hidden, but the following empty hidden line causes trouble.
//! # // There is indeed a space after '#'
//! #
//! # #[test] fn egal() {
//! // visible
//! # }
... the generated markdown looks like this ...
... and the output of cargo test like that:
[...]
---- _0 stdout ----
<anon>:5:1: 5:2 error: expected one of `!` or `[`, found `#`<anon>:5 #[test] fn egal() { ^thread '_0' panicked at 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libsyntax/diagnostic.rs:92[...]
If the empty hidden line # is removed, it will work such as in the following:
//! ```test_harness,norun
//! # // The hidden empty line was removed, which fixes the issue.
//! # #[test] fn egal() {
//! // visible
//! # }
This is a minor issue, but one that can cause some headaches as people might just not understand what's wrong that easily, at least when looking at the error messages.
Desired behaviour would be to just ignore empty hidden lines entirely.
Activity
Byron commentedon Apr 10, 2015
Thank you :) !