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:
commit
bcba3b9968
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user