Skip to content

Commit 870144f

Browse files
Rollup merge of rust-lang#54057 - matthiaskrgr:stabilize-edition-plus-clippy, r=alexcrichton
Stabilize edition 2018; also updates Clippy and RLS Supersedes rust-lang#53999 Clippy build was failing there because crate_visibility_modifier feature was taken out of edition 2018 and clippy used it. The clippy update enables the corresponding feature explicitly. r? @Mark-Simulacrum
2 parents 56ceb16 + 3e56dec commit 870144f

15 files changed

+27
-26
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/feature_gate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ declare_features! (
389389
(active, non_exhaustive, "1.22.0", Some(44109), None),
390390

391391
// `crate` as visibility modifier, synonymous to `pub(crate)`
392-
(active, crate_visibility_modifier, "1.23.0", Some(45388), Some(Edition::Edition2018)),
392+
(active, crate_visibility_modifier, "1.23.0", Some(45388), None),
393393

394394
// extern types
395395
(active, extern_types, "1.23.0", Some(43467), None),

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
}

src/test/ui-fulldeps/unnecessary-extern-crate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// edition:2018
1212

1313
#![deny(unused_extern_crates)]
14-
#![feature(alloc, test, libc)]
14+
#![feature(alloc, test, libc, crate_visibility_modifier)]
1515

1616
extern crate alloc;
1717
//~^ ERROR unused extern crate

src/test/ui/crate-in-paths.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// edition:2018
1212

13-
#![feature(edition_2018_preview)]
13+
#![feature(crate_visibility_modifier)]
1414

1515
mod bar {
1616
crate struct Foo;

src/test/ui/rust-2018/edition-lint-fully-qualified-paths.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// run-rustfix
1212

13-
#![feature(rust_2018_preview)]
13+
#![feature(rust_2018_preview, crate_visibility_modifier)]
1414
#![deny(absolute_paths_not_starting_with_crate)]
1515

1616
mod foo {

src/test/ui/rust-2018/edition-lint-fully-qualified-paths.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// run-rustfix
1212

13-
#![feature(rust_2018_preview)]
13+
#![feature(rust_2018_preview, crate_visibility_modifier)]
1414
#![deny(absolute_paths_not_starting_with_crate)]
1515

1616
mod foo {

src/test/ui/rust-2018/edition-lint-nested-empty-paths.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// run-rustfix
1212

13-
#![feature(rust_2018_preview)]
13+
#![feature(rust_2018_preview, crate_visibility_modifier)]
1414
#![deny(absolute_paths_not_starting_with_crate)]
1515
#![allow(unused_imports)]
1616
#![allow(dead_code)]

src/test/ui/rust-2018/edition-lint-nested-empty-paths.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// run-rustfix
1212

13-
#![feature(rust_2018_preview)]
13+
#![feature(rust_2018_preview, crate_visibility_modifier)]
1414
#![deny(absolute_paths_not_starting_with_crate)]
1515
#![allow(unused_imports)]
1616
#![allow(dead_code)]

src/test/ui/rust-2018/edition-lint-nested-paths.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// run-rustfix
1212

13-
#![feature(rust_2018_preview)]
13+
#![feature(rust_2018_preview, crate_visibility_modifier)]
1414
#![deny(absolute_paths_not_starting_with_crate)]
1515

1616
use crate::foo::{a, b};

src/test/ui/rust-2018/edition-lint-nested-paths.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// run-rustfix
1212

13-
#![feature(rust_2018_preview)]
13+
#![feature(rust_2018_preview, crate_visibility_modifier)]
1414
#![deny(absolute_paths_not_starting_with_crate)]
1515

1616
use foo::{a, b};

src/tools/clippy

src/tools/rls

Submodule rls updated from cf6358a to 5b5cd9d

0 commit comments

Comments
 (0)