Skip to content

Commit

Permalink
Rollup merge of rust-lang#54057 - matthiaskrgr:stabilize-edition-plus…
Browse files Browse the repository at this point in the history
…-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
  • Loading branch information
Mark-Simulacrum authored Sep 8, 2018
2 parents 56ceb16 + 3e56dec commit 870144f
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 26 deletions.
14 changes: 14 additions & 0 deletions src/doc/rustdoc/src/command-line-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

13 changes: 0 additions & 13 deletions src/doc/rustdoc/src/unstable-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ declare_features! (
(active, non_exhaustive, "1.22.0", Some(44109), None),

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

// extern types
(active, extern_types, "1.23.0", Some(43467), None),
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax_pos/edition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl Edition {
pub fn is_stable(&self) -> bool {
match *self {
Edition::Edition2015 => true,
Edition::Edition2018 => false,
Edition::Edition2018 => true,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui-fulldeps/unnecessary-extern-crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// edition:2018

#![deny(unused_extern_crates)]
#![feature(alloc, test, libc)]
#![feature(alloc, test, libc, crate_visibility_modifier)]

extern crate alloc;
//~^ ERROR unused extern crate
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/crate-in-paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// edition:2018

#![feature(edition_2018_preview)]
#![feature(crate_visibility_modifier)]

mod bar {
crate struct Foo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// run-rustfix

#![feature(rust_2018_preview)]
#![feature(rust_2018_preview, crate_visibility_modifier)]
#![deny(absolute_paths_not_starting_with_crate)]

mod foo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// run-rustfix

#![feature(rust_2018_preview)]
#![feature(rust_2018_preview, crate_visibility_modifier)]
#![deny(absolute_paths_not_starting_with_crate)]

mod foo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// run-rustfix

#![feature(rust_2018_preview)]
#![feature(rust_2018_preview, crate_visibility_modifier)]
#![deny(absolute_paths_not_starting_with_crate)]
#![allow(unused_imports)]
#![allow(dead_code)]
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/rust-2018/edition-lint-nested-empty-paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// run-rustfix

#![feature(rust_2018_preview)]
#![feature(rust_2018_preview, crate_visibility_modifier)]
#![deny(absolute_paths_not_starting_with_crate)]
#![allow(unused_imports)]
#![allow(dead_code)]
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/rust-2018/edition-lint-nested-paths.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// run-rustfix

#![feature(rust_2018_preview)]
#![feature(rust_2018_preview, crate_visibility_modifier)]
#![deny(absolute_paths_not_starting_with_crate)]

use crate::foo::{a, b};
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/rust-2018/edition-lint-nested-paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// run-rustfix

#![feature(rust_2018_preview)]
#![feature(rust_2018_preview, crate_visibility_modifier)]
#![deny(absolute_paths_not_starting_with_crate)]

use foo::{a, b};
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy
2 changes: 1 addition & 1 deletion src/tools/rls
Submodule rls updated from cf6358 to 5b5cd9

0 comments on commit 870144f

Please sign in to comment.