1
Fork 0

Auto merge of #54057 - matthiaskrgr:stabilize-edition-plus-clippy, r=Mark-Simulacrum

Stabilize edition 2018; also updates Clippy, RLS and Cargo

Supersedes https://github.com/rust-lang/rust/pull/53999 , https://github.com/rust-lang/rust/pull/53935
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
This commit is contained in:
bors 2018-09-09 16:09:39 +00:00
commit f50b7758f4
18 changed files with 34 additions and 31 deletions

View file

@ -172,13 +172,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "cargo" name = "cargo"
version = "0.30.0" version = "0.31.0"
dependencies = [ dependencies = [
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"crates-io 0.18.0", "crates-io 0.19.0",
"crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"crypto-hash 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "crypto-hash 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"curl 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "curl 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)",
@ -452,7 +452,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "crates-io" name = "crates-io"
version = "0.18.0" version = "0.19.0"
dependencies = [ dependencies = [
"curl 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)", "curl 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1753,7 +1753,7 @@ dependencies = [
name = "rls" name = "rls"
version = "0.130.5" version = "0.130.5"
dependencies = [ dependencies = [
"cargo 0.30.0", "cargo 0.31.0",
"cargo_metadata 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "cargo_metadata 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy_lints 0.0.212", "clippy_lints 0.0.212",
"crossbeam-channel 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-channel 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",

View file

@ -237,6 +237,8 @@ impl Step for Cargo {
// Don't run cross-compile tests, we may not have cross-compiled libstd libs // Don't run cross-compile tests, we may not have cross-compiled libstd libs
// available. // available.
cargo.env("CFG_DISABLE_CROSS_TESTS", "1"); cargo.env("CFG_DISABLE_CROSS_TESTS", "1");
// Disable a test that has issues with mingw.
cargo.env("CARGO_TEST_DISABLE_GIT_CLI", "1");
try_run( try_run(
builder, builder,

View file

@ -345,3 +345,17 @@ $ rustdoc src/lib.rs --sysroot /path/to/sysroot
Similar to `rustc --sysroot`, this lets you change the sysroot `rustdoc` uses Similar to `rustc --sysroot`, this lets you change the sysroot `rustdoc` uses
when compiling your code. 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).

View file

@ -346,19 +346,6 @@ details.
[issue-display-warnings]: https://github.com/rust-lang/rust/issues/41574 [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 ### `--extern-html-root-url`: control how rustdoc links to non-local crates
Using this flag looks like this: Using this flag looks like this:

View file

@ -286,7 +286,7 @@ fn opts() -> Vec<RustcOptGroup> {
\"light-suffix.css\"", \"light-suffix.css\"",
"PATH") "PATH")
}), }),
unstable("edition", |o| { stable("edition", |o| {
o.optopt("", "edition", o.optopt("", "edition",
"edition to use when compiling rust code (default: 2015)", "edition to use when compiling rust code (default: 2015)",
"EDITION") "EDITION")

View file

@ -389,7 +389,7 @@ declare_features! (
(active, non_exhaustive, "1.22.0", Some(44109), None), (active, non_exhaustive, "1.22.0", Some(44109), None),
// `crate` as visibility modifier, synonymous to `pub(crate)` // `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 // extern types
(active, extern_types, "1.23.0", Some(43467), None), (active, extern_types, "1.23.0", Some(43467), None),

View file

@ -65,7 +65,7 @@ impl Edition {
pub fn is_stable(&self) -> bool { pub fn is_stable(&self) -> bool {
match *self { match *self {
Edition::Edition2015 => true, Edition::Edition2015 => true,
Edition::Edition2018 => false, Edition::Edition2018 => true,
} }
} }
} }

View file

@ -11,7 +11,7 @@
// edition:2018 // edition:2018
#![deny(unused_extern_crates)] #![deny(unused_extern_crates)]
#![feature(alloc, test, libc)] #![feature(alloc, test, libc, crate_visibility_modifier)]
extern crate alloc; extern crate alloc;
//~^ ERROR unused extern crate //~^ ERROR unused extern crate

View file

@ -10,7 +10,7 @@
// edition:2018 // edition:2018
#![feature(edition_2018_preview)] #![feature(crate_visibility_modifier)]
mod bar { mod bar {
crate struct Foo; crate struct Foo;

View file

@ -10,7 +10,7 @@
// run-rustfix // run-rustfix
#![feature(rust_2018_preview)] #![feature(rust_2018_preview, crate_visibility_modifier)]
#![deny(absolute_paths_not_starting_with_crate)] #![deny(absolute_paths_not_starting_with_crate)]
mod foo { mod foo {

View file

@ -10,7 +10,7 @@
// run-rustfix // run-rustfix
#![feature(rust_2018_preview)] #![feature(rust_2018_preview, crate_visibility_modifier)]
#![deny(absolute_paths_not_starting_with_crate)] #![deny(absolute_paths_not_starting_with_crate)]
mod foo { mod foo {

View file

@ -10,7 +10,7 @@
// run-rustfix // run-rustfix
#![feature(rust_2018_preview)] #![feature(rust_2018_preview, crate_visibility_modifier)]
#![deny(absolute_paths_not_starting_with_crate)] #![deny(absolute_paths_not_starting_with_crate)]
#![allow(unused_imports)] #![allow(unused_imports)]
#![allow(dead_code)] #![allow(dead_code)]

View file

@ -10,7 +10,7 @@
// run-rustfix // run-rustfix
#![feature(rust_2018_preview)] #![feature(rust_2018_preview, crate_visibility_modifier)]
#![deny(absolute_paths_not_starting_with_crate)] #![deny(absolute_paths_not_starting_with_crate)]
#![allow(unused_imports)] #![allow(unused_imports)]
#![allow(dead_code)] #![allow(dead_code)]

View file

@ -10,7 +10,7 @@
// run-rustfix // run-rustfix
#![feature(rust_2018_preview)] #![feature(rust_2018_preview, crate_visibility_modifier)]
#![deny(absolute_paths_not_starting_with_crate)] #![deny(absolute_paths_not_starting_with_crate)]
use crate::foo::{a, b}; use crate::foo::{a, b};

View file

@ -10,7 +10,7 @@
// run-rustfix // run-rustfix
#![feature(rust_2018_preview)] #![feature(rust_2018_preview, crate_visibility_modifier)]
#![deny(absolute_paths_not_starting_with_crate)] #![deny(absolute_paths_not_starting_with_crate)]
use foo::{a, b}; use foo::{a, b};

@ -1 +1 @@
Subproject commit 0ec7281b9c36ca7f724bfac8b029633910270a48 Subproject commit 2fb77a49b43bf7266793c07a19a06749e6a8ad5a

@ -1 +1 @@
Subproject commit cafef7b576203f166add9ed143979d9775c25219 Subproject commit fdd830f52c082b83db0dac3e0066c0cf114050d2

@ -1 +1 @@
Subproject commit cf6358a00540a83dcc6e8c243f3306ccdbb9c354 Subproject commit 5b5cd9d45719414196e254ec17baa598acc8cd25