Skip to content

Stabilize edition 2018; also updates Clippy, RLS and Cargo #54057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "cargo"
version = "0.30.0"
version = "0.31.0"
dependencies = [
"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)",
"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)",
"crates-io 0.18.0",
"crates-io 0.19.0",
"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)",
"curl 0.4.14 (registry+https://github.com/rust-lang/crates.io-index)",
Expand Down Expand Up @@ -452,7 +452,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "crates-io"
version = "0.18.0"
version = "0.19.0"
dependencies = [
"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)",
Expand Down Expand Up @@ -1753,7 +1753,7 @@ dependencies = [
name = "rls"
version = "0.130.5"
dependencies = [
"cargo 0.30.0",
"cargo 0.31.0",
"cargo_metadata 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy_lints 0.0.212",
"crossbeam-channel 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ impl Step for Cargo {
// Don't run cross-compile tests, we may not have cross-compiled libstd libs
// available.
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(
builder,
Expand Down
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/cargo
Submodule cargo updated 117 files
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