cfg_attr based modification of ticks is split into two code chunks
drahnr opened this issue · comments
Bernhard Schuster commented
Describe the bug
Some code blocks are not ignored as block.
To Reproduce
Steps to reproduce the behaviour:
- A file containing
/// # Example
///
#[cfg_attr(unix, doc = "```no_run")]
#[cfg_attr(not(unix), doc = "```ignore")]
/// use std::path::Path;
/// assert_eq!(Path::new("./is_a_directory/").is_dir(), true);
/// ```
- Run
cargo spellcheck ...
- ...
Expected behavior
Ignore the code
Screenshots
Please complete the following information:
- System: Fedora
- Obtained: git
- Version: 0.11.2
Additional context
Bernhard Schuster commented
In rust (a39ac5ae175e0f9f910b1800a430b488ec0f2105
) there are a handful of instances of the pattern:
library/std/src/path.rs: #[cfg_attr(unix, doc = "```no_run")]
library/std/src/path.rs: #[cfg_attr(not(unix), doc = "```ignore")]
library/std/src/fs.rs: #[cfg_attr(unix, doc = "```no_run")]
library/std/src/fs.rs: #[cfg_attr(not(unix), doc = "```ignore")]
library/std/src/os/unix/net/stream.rs: #[cfg_attr(any(target_os = "android", target_os = "linux"), doc = "```no_run")]
library/std/src/os/unix/net/stream.rs: #[cfg_attr(not(any(target_os = "android", target_os = "linux")), doc = "```ignore")]
library/std/src/os/unix/net/datagram.rs: #[cfg_attr(any(target_os = "android", target_os = "linux"), doc = "```no_run")]
library/std/src/os/unix/net/datagram.rs: #[cfg_attr(not(any(target_os = "android", target_os = "linux")), doc = "```ignore")]
src/tools/clippy/tests/ui/doc/doc-fixable.rs:#[cfg_attr(feature = "a", doc = " ```")]
src/tools/clippy/tests/ui/doc/doc-fixable.rs:#[cfg_attr(not(feature = "a"), doc = " ```ignore")]
src/tools/clippy/tests/ui/doc/doc-fixable.fixed:#[cfg_attr(feature = "a", doc = " ```")]
src/tools/clippy/tests/ui/doc/doc-fixable.fixed:#[cfg_attr(not(feature = "a"), doc = " ```ignore")]