From: Mark Rousskov Date: Thu, 6 Sep 2018 16:20:01 +0000 (-0600) Subject: Stabilize the 2018 edition X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=4d1ec818118c6c5dac5af19b291b9601ef98c17e;p=rust.git Stabilize the 2018 edition --- diff --git a/src/doc/rustdoc/src/command-line-arguments.md b/src/doc/rustdoc/src/command-line-arguments.md index 417608cc5ca..aba485f752a 100644 --- a/src/doc/rustdoc/src/command-line-arguments.md +++ b/src/doc/rustdoc/src/command-line-arguments.md @@ -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). + diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index 32fb8c2f7d5..071575b1fc0 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -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: diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 1acae86f006..3211607807f 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -286,7 +286,7 @@ fn opts() -> Vec { \"light-suffix.css\"", "PATH") }), - unstable("edition", |o| { + stable("edition", |o| { o.optopt("", "edition", "edition to use when compiling rust code (default: 2015)", "EDITION") diff --git a/src/libsyntax_pos/edition.rs b/src/libsyntax_pos/edition.rs index fce8fc3db4e..7709db72a02 100644 --- a/src/libsyntax_pos/edition.rs +++ b/src/libsyntax_pos/edition.rs @@ -65,7 +65,7 @@ pub fn feature_name(&self) -> &'static str { pub fn is_stable(&self) -> bool { match *self { Edition::Edition2015 => true, - Edition::Edition2018 => false, + Edition::Edition2018 => true, } } }