Stabilize the 2018 edition
This commit is contained in:
parent
0198a1ea45
commit
4d1ec81811
4 changed files with 16 additions and 15 deletions
|
@ -345,3 +345,17 @@ $ rustdoc src/lib.rs --sysroot /path/to/sysroot
|
|||
|
||||
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).
|
||||
|
||||
|
|
|
@ -346,19 +346,6 @@ 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).
|
||||
|
||||
### `--extern-html-root-url`: control how rustdoc links to non-local crates
|
||||
|
||||
Using this flag looks like this:
|
||||
|
|
|
@ -286,7 +286,7 @@ fn opts() -> Vec<RustcOptGroup> {
|
|||
\"light-suffix.css\"",
|
||||
"PATH")
|
||||
}),
|
||||
unstable("edition", |o| {
|
||||
stable("edition", |o| {
|
||||
o.optopt("", "edition",
|
||||
"edition to use when compiling rust code (default: 2015)",
|
||||
"EDITION")
|
||||
|
|
|
@ -65,7 +65,7 @@ impl Edition {
|
|||
pub fn is_stable(&self) -> bool {
|
||||
match *self {
|
||||
Edition::Edition2015 => true,
|
||||
Edition::Edition2018 => false,
|
||||
Edition::Edition2018 => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue