Skip to content

Commit

Permalink
Rollup merge of #53999 - Mark-Simulacrum:stabilize-edition, r=alexcri…
Browse files Browse the repository at this point in the history
…chton

Stabilize 2018 edition

r? @eddyb
cc @Centril @aturon
  • Loading branch information
kennytm committed Sep 7, 2018
2 parents 6b2d5b4 + 8c3ac3c commit 1e4aa65
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 24 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 @@ -288,7 +288,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

0 comments on commit 1e4aa65

Please sign in to comment.