Skip to content

Commit 73dd19f

Browse files
Stabilize the 2018 edition
1 parent 35a5541 commit 73dd19f

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

src/doc/rustdoc/src/command-line-arguments.md

+14
Original file line numberDiff line numberDiff line change
@@ -345,3 +345,17 @@ $ rustdoc src/lib.rs --sysroot /path/to/sysroot
345345

346346
Similar to `rustc --sysroot`, this lets you change the sysroot `rustdoc` uses
347347
when compiling your code.
348+
349+
### `--edition`: control the edition of docs and doctests
350+
351+
Using this flag looks like this:
352+
353+
```bash
354+
$ rustdoc src/lib.rs --edition 2018
355+
$ rustdoc --test src/lib.rs --edition 2018
356+
```
357+
358+
This flag allows rustdoc to treat your rust code as the given edition. It will compile doctests with
359+
the given edition as well. As with `rustc`, the default edition that `rustdoc` will use is `2015`
360+
(the first edition).
361+

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

-13
Original file line numberDiff line numberDiff line change
@@ -346,19 +346,6 @@ details.
346346

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

349-
### `--edition`: control the edition of docs and doctests
350-
351-
Using this flag looks like this:
352-
353-
```bash
354-
$ rustdoc src/lib.rs -Z unstable-options --edition 2018
355-
$ rustdoc --test src/lib.rs -Z unstable-options --edition 2018
356-
```
357-
358-
This flag allows rustdoc to treat your rust code as the given edition. It will compile doctests with
359-
the given edition as well. As with `rustc`, the default edition that `rustdoc` will use is `2015`
360-
(the first edition).
361-
362349
### `--extern-html-root-url`: control how rustdoc links to non-local crates
363350

364351
Using this flag looks like this:

src/librustdoc/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ fn opts() -> Vec<RustcOptGroup> {
286286
\"light-suffix.css\"",
287287
"PATH")
288288
}),
289-
unstable("edition", |o| {
289+
stable("edition", |o| {
290290
o.optopt("", "edition",
291291
"edition to use when compiling rust code (default: 2015)",
292292
"EDITION")

src/libsyntax_pos/edition.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl Edition {
6565
pub fn is_stable(&self) -> bool {
6666
match *self {
6767
Edition::Edition2015 => true,
68-
Edition::Edition2018 => false,
68+
Edition::Edition2018 => true,
6969
}
7070
}
7171
}

0 commit comments

Comments
 (0)