Skip to content
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

Stabilize 2018 edition #53999

Closed
Closed
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
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