Rollup merge of #50852 - mandeep:fix-rustdoc-example-testing, r=GuillaumeGomez

Add doc comment to hiding portions of code example

fixes #50816

Not sure if this is all that's needed, but I think it's a good start. One thing to note is that the code block is a text block where it could possibly be a rust block.
This commit is contained in:
Mark Simulacrum 2018-06-05 08:33:43 -06:00 committed by GitHub
commit bcba3b9968
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,8 +79,9 @@ from your example, but are important to make the tests work. Consider
an example block that looks like this:
```text
/// Some documentation.
# fn foo() {}
/// /// Some documentation.
/// # fn foo() {} // this function will be hidden
/// println!("Hello, World!");
```
It will render like this:
@ -88,6 +89,7 @@ It will render like this:
```rust
/// Some documentation.
# fn foo() {}
println!("Hello, World!");
```
Yes, that's right: you can add lines that start with `# `, and they will