Skip to content

Commit 41a7e15

Browse files
committed
Auto merge of #6387 - dwijnand:rust-2018, r=dwijnand
Upgrade to Rust 2018 & fix edition idioms None
2 parents cae455e + 5aebc8a commit 41a7e15

File tree

206 files changed

+696
-694
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+696
-694
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ matrix:
3636
# increased every 6 weeks or so when the first PR to use a new feature.
3737
- env: TARGET=x86_64-unknown-linux-gnu
3838
ALT=i686-unknown-linux-gnu
39-
rust: 1.28.0
39+
rust: 1.31.0
4040
script:
4141
- rustup toolchain install nightly
4242
- cargo +nightly generate-lockfile -Z minimal-versions

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[package]
22
name = "cargo"
33
version = "0.33.0"
4+
edition = "2018"
45
authors = ["Yehuda Katz <wycats@gmail.com>",
56
"Carl Lerche <me@carllerche.com>",
67
"Alex Crichton <alex@alexcrichton.com>"]

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ install:
1111
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
1212
- rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain nightly
1313
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
14-
- if defined MINIMAL_VERSIONS rustup toolchain install 1.28.0
14+
- if defined MINIMAL_VERSIONS rustup toolchain install 1.31.0
1515
- if defined OTHER_TARGET rustup target add %OTHER_TARGET%
1616
- rustc -V
1717
- cargo -V
@@ -25,5 +25,5 @@ test_script:
2525
# we don't have ci time to run the full `cargo test` with `minimal-versions` like
2626
# - if defined MINIMAL_VERSIONS cargo +nightly generate-lockfile -Z minimal-versions && cargo +stable test
2727
# so we just run `cargo check --tests` like
28-
- if defined MINIMAL_VERSIONS cargo +nightly generate-lockfile -Z minimal-versions && cargo +1.28.0 check --tests
28+
- if defined MINIMAL_VERSIONS cargo +nightly generate-lockfile -Z minimal-versions && cargo +1.31.0 check --tests
2929
- if NOT defined MINIMAL_VERSIONS cargo test

src/bin/cargo/cli.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
extern crate clap;
1+
use clap;
22

33
use clap::{AppSettings, Arg, ArgMatches};
44

55
use cargo::{self, CliResult, Config};
66

77
use super::commands;
88
use super::list_commands;
9-
use command_prelude::*;
9+
use crate::command_prelude::*;
1010

1111
pub fn main(config: &mut Config) -> CliResult {
1212
let args = match cli().get_matches_safe() {
@@ -132,7 +132,7 @@ fn expand_aliases(
132132
Ok(args)
133133
}
134134

135-
fn execute_subcommand(config: &mut Config, args: &ArgMatches) -> CliResult {
135+
fn execute_subcommand(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
136136
let (cmd, subcommand_args) = match args.subcommand() {
137137
(cmd, Some(args)) => (cmd, args),
138138
_ => {

src/bin/cargo/commands/bench.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use command_prelude::*;
1+
use crate::command_prelude::*;
22

33
use cargo::ops::{self, TestOptions};
44

@@ -70,7 +70,7 @@ Compilation can be customized with the `bench` profile in the manifest.
7070
)
7171
}
7272

73-
pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
73+
pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
7474
let ws = args.workspace(config)?;
7575
let mut compile_opts = args.compile_options(config, CompileMode::Bench)?;
7676
compile_opts.build_config.release = true;

src/bin/cargo/commands/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use command_prelude::*;
1+
use crate::command_prelude::*;
22

33
use cargo::ops;
44

@@ -46,7 +46,7 @@ the --release flag will use the `release` profile instead.
4646
)
4747
}
4848

49-
pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
49+
pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
5050
let ws = args.workspace(config)?;
5151
let mut compile_opts = args.compile_options(config, CompileMode::Build)?;
5252
compile_opts.export_dir = args.value_of_path("out-dir", config);

src/bin/cargo/commands/check.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use command_prelude::*;
1+
use crate::command_prelude::*;
22

33
use cargo::ops;
44

@@ -53,7 +53,7 @@ The `--profile test` flag can be used to check unit tests with the
5353
)
5454
}
5555

56-
pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
56+
pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
5757
let ws = args.workspace(config)?;
5858
let test = match args.value_of("profile") {
5959
Some("test") => true,

src/bin/cargo/commands/clean.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use command_prelude::*;
1+
use crate::command_prelude::*;
22

33
use cargo::ops::{self, CleanOptions};
44

@@ -21,7 +21,7 @@ and its format, see the `cargo help pkgid` command.
2121
)
2222
}
2323

24-
pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
24+
pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
2525
let ws = args.workspace(config)?;
2626
let opts = CleanOptions {
2727
config,

src/bin/cargo/commands/doc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use command_prelude::*;
1+
use crate::command_prelude::*;
22

33
use cargo::ops::{self, DocOptions};
44

@@ -45,7 +45,7 @@ the `cargo help pkgid` command.
4545
)
4646
}
4747

48-
pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
48+
pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
4949
let ws = args.workspace(config)?;
5050
let mode = CompileMode::Doc {
5151
deps: !args.is_present("no-deps"),

src/bin/cargo/commands/fetch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use command_prelude::*;
1+
use crate::command_prelude::*;
22

33
use cargo::ops;
44
use cargo::ops::FetchOptions;
@@ -22,7 +22,7 @@ all updated.
2222
)
2323
}
2424

25-
pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
25+
pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
2626
let ws = args.workspace(config)?;
2727

2828
let opts = FetchOptions {

0 commit comments

Comments
 (0)