This is documented in The rustdoc book, specifically the chapter about attributes.
Your opening codeblock delimiter should look like:
/// ```no_run
From the book:
/// ```no_run /// loop { /// println!("Hello, world"); /// } /// ```The
no_runattribute will compile your code, but not run it. This is
important for examples such as “Here’s how to retrieve a web page,”
which you would want to ensure compiles, but might be run in a test
environment that has no network access.
To omit build completely use ignore instead of no_run.