Skip to content

Commit a0e48dd

Browse files
talk about --edition in the Rustdoc Book
1 parent 7f548bc commit a0e48dd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/doc/rustdoc/src/unstable-features.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,19 @@ details.
348348

349349
[issue-display-warnings]: https://github.com/rust-lang/rust/issues/41574
350350

351+
### `--edition`: control the edition of docs and doctests
352+
353+
Using this flag looks like this:
354+
355+
```bash
356+
$ rustdoc src/lib.rs -Z unstable-options --edition 2018
357+
$ rustdoc --test src/lib.rs -Z unstable-options --edition 2018
358+
```
359+
360+
This flag allows rustdoc to treat your rust code as the given edition. It will compile doctests with
361+
the given edition as well. As with `rustc`, the default edition that `rustdoc` will use is `2015`
362+
(the first edition).
363+
351364
### `-Z force-unstable-if-unmarked`
352365

353366
Using this flag looks like this:

0 commit comments

Comments
 (0)