Apache DataFusion SQL Query Engine
docs: note the rustdoc trick for hiding use statements in examples (#25718)
Alessandro Solimandofcab0020c173
diff --git a/docs/source/contributor-guide/testing.md b/docs/source/contributor-guide/testing.mdindex 4ba7d9d011..4c097ae498 100644--- a/docs/source/contributor-guide/testing.md+++ b/docs/source/contributor-guide/testing.md@@ -176,6 +176,20 @@ cargo test --docAs with other Rust projects, examples in doc comments in `.rs` files areautomatically checked to ensure they work and evolve along with the code.+Prefix a line with `# ` (a `#` followed by a space) to keep it compiled and+run, but hidden from the rendered documentation. This is most useful for+`use` statements, since readers care about the API being demonstrated, not+its import boilerplate:++````rust+/// ```+/// # use std::sync::Arc;+/// let value = Arc::new(42);+/// ```+````++Only the `let value = ...` line renders.+### User Guide DocumentationRust example code from the user guide (anything marked with \`\`\`rust) is also