]> git.lizzy.rs Git - rust.git/commitdiff
Add precision for rustdoc block codes
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Sat, 2 Sep 2017 20:03:12 +0000 (22:03 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Sun, 3 Sep 2017 11:15:16 +0000 (13:15 +0200)
src/doc/rustdoc/src/documentation-tests.md

index 348fcd3b76920aee7bf1482528afa69ba220ef8b..eb3e6a9dd5067ee9c96acec3527499f795491f00 100644 (file)
@@ -16,6 +16,19 @@ The basic idea is this:
 The triple backticks start and end code blocks. If this were in a file named `foo.rs`,
 running `rustdoc --test foo.rs` will extract this example, and then run it as a test.
 
+Please note that by default, if no language is set for the block code, `rustdoc`
+assumes it is `Rust` code. So the following:
+
+```rust
+let x = 5;
+```
+
+is strictly equivalent to:
+
+```
+let x = 5;
+```
+
 There's some subtlety though! Read on for more details.
 
 ## Pre-processing examples