From a0e48dde7c9d8cc7be9b22d7cf52a9549b5b0637 Mon Sep 17 00:00:00 2001 From: QuietMisdreavus Date: Tue, 27 Mar 2018 16:36:15 +0200 Subject: talk about --edition in the Rustdoc Book --- src/doc/rustdoc/src/unstable-features.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/doc') diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index 16356c20c70..b43ecab9d00 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -348,6 +348,19 @@ details. [issue-display-warnings]: https://github.com/rust-lang/rust/issues/41574 +### `--edition`: control the edition of docs and doctests + +Using this flag looks like this: + +```bash +$ rustdoc src/lib.rs -Z unstable-options --edition 2018 +$ rustdoc --test src/lib.rs -Z unstable-options --edition 2018 +``` + +This flag allows rustdoc to treat your rust code as the given edition. It will compile doctests with +the given edition as well. As with `rustc`, the default edition that `rustdoc` will use is `2015` +(the first edition). + ### `-Z force-unstable-if-unmarked` Using this flag looks like this: -- cgit 1.4.1-3-g733a5