1
Fork 0

Stabilize the 2018 edition

This commit is contained in:
Mark Rousskov 2018-09-06 10:20:01 -06:00 committed by Matthias Krüger
parent 0198a1ea45
commit 4d1ec81811
4 changed files with 16 additions and 15 deletions

View file

@ -345,3 +345,17 @@ $ rustdoc src/lib.rs --sysroot /path/to/sysroot
Similar to `rustc --sysroot`, this lets you change the sysroot `rustdoc` uses Similar to `rustc --sysroot`, this lets you change the sysroot `rustdoc` uses
when compiling your code. 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).

View file

@ -346,19 +346,6 @@ details.
[issue-display-warnings]: https://github.com/rust-lang/rust/issues/41574 [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 ### `--extern-html-root-url`: control how rustdoc links to non-local crates
Using this flag looks like this: Using this flag looks like this:

View file

@ -286,7 +286,7 @@ fn opts() -> Vec<RustcOptGroup> {
\"light-suffix.css\"", \"light-suffix.css\"",
"PATH") "PATH")
}), }),
unstable("edition", |o| { stable("edition", |o| {
o.optopt("", "edition", o.optopt("", "edition",
"edition to use when compiling rust code (default: 2015)", "edition to use when compiling rust code (default: 2015)",
"EDITION") "EDITION")

View file

@ -65,7 +65,7 @@ impl Edition {
pub fn is_stable(&self) -> bool { pub fn is_stable(&self) -> bool {
match *self { match *self {
Edition::Edition2015 => true, Edition::Edition2015 => true,
Edition::Edition2018 => false, Edition::Edition2018 => true,
} }
} }
} }