Similar to `rustc --sysroot`, this lets you change the sysroot `rustdoc` uses
when compiling your code.
+
+### `--edition`: control the edition of docs and doctests
+
+Using this flag looks like this:
+
+```bash
+$ rustdoc src/lib.rs --edition 2018
+$ rustdoc --test src/lib.rs --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).
+
[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).
-
### `--extern-html-root-url`: control how rustdoc links to non-local crates
Using this flag looks like this:
\"light-suffix.css\"",
"PATH")
}),
- unstable("edition", |o| {
+ stable("edition", |o| {
o.optopt("", "edition",
"edition to use when compiling rust code (default: 2015)",
"EDITION")
pub fn is_stable(&self) -> bool {
match *self {
Edition::Edition2015 => true,
- Edition::Edition2018 => false,
+ Edition::Edition2018 => true,
}
}
}