Description
If you use rust,ignore
to ignore doctests which don't compile (often because you want to include example code that's entirely expository in your documentation — something that doesn't compile at all, and should merely syntax highlight as Rust), they still are attempted to compile and run when you pass --ignored
to the test runner.
This is unfortunate, as this is what you use to run #[ignore]
d tests, which are good (intended?) for tests that are too slow to complete in normal execution, often ones which are exhaustive. Having doctests that fail to compile be mixed in here means this use of #[ignore]
is effectively broken.
The workaround I know for this is rather gross, e.g. using a const _: &str = stringify!{ /* code that doesn't compile here */ }
wrapper (for example — even if using ignore
wouldn't have been an alternative here since it's large enough that you'd rather ensure it compiles in practice, this is the pattern I'm referring to).
I think it's honestly a bug that this is the effect of rust,ignore
, and think that instead it should be to just not emit the test.
(This is related to, but distinct from #30032)
I bugged @jyn514 about this once and he indicated he thought it might require an RFC to fix, but when I was complaining about it elsewhere recently, someone pointed out that there was no bug on file for it already.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status