How to opt out of doc tests?

#1

I searched for a way of opting out of doc tests and found no_run as in:

'''rust,no_run
dont_run_me();
'''

(I used ' for backticks above).

However, that doesn’t seem to work with rust 1.32. What should I be using: and where is it documented?

#2

That is the correct syntax. It’s documented in the rustdoc book. Why do you think it’s not working?

#3

no_run means “this should compile, but don’t try to execute it.” ignore is what you want.

#4

Thanks for that link. I didn’t mean no_run (since that still compiles), I meant ignore, which I now use and it works fine.

Thanks.