From cabe1cca0a24574bb27832f22800b87653d45ca3 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 22 Oct 2021 10:24:49 -0700 Subject: [PATCH 1/4] Upgrade Cargo to the 2021 edition This didn't actually result in any code changes yet, for now this simply flips the edition flag for all of our crates and documentation. --- Cargo.toml | 2 +- benches/benchsuite/Cargo.toml | 2 +- benches/capture/Cargo.toml | 2 +- crates/cargo-platform/Cargo.toml | 2 +- crates/cargo-test-macro/Cargo.toml | 2 +- crates/cargo-test-support/Cargo.toml | 2 +- crates/cargo-util/Cargo.toml | 2 +- crates/crates-io/Cargo.toml | 2 +- crates/credential/cargo-credential-1password/Cargo.toml | 2 +- crates/credential/cargo-credential-gnome-secret/Cargo.toml | 2 +- .../credential/cargo-credential-macos-keychain/Cargo.toml | 2 +- crates/credential/cargo-credential-wincred/Cargo.toml | 2 +- crates/credential/cargo-credential/Cargo.toml | 2 +- crates/mdman/Cargo.toml | 2 +- src/doc/semver-check/Cargo.toml | 2 +- src/doc/src/getting-started/first-steps.md | 2 +- src/doc/src/guide/creating-a-new-project.md | 2 +- src/doc/src/guide/dependencies.md | 2 +- src/doc/src/reference/build-script-examples.md | 6 +++--- 19 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 87e98339d..023a63b45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cargo" version = "0.59.0" -edition = "2018" +edition = "2021" authors = ["Yehuda Katz ", "Carl Lerche ", "Alex Crichton "] diff --git a/benches/benchsuite/Cargo.toml b/benches/benchsuite/Cargo.toml index 5c0995d27..975321075 100644 --- a/benches/benchsuite/Cargo.toml +++ b/benches/benchsuite/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "benchsuite" version = "0.1.0" -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" homepage = "https://github.com/rust-lang/cargo" repository = "https://github.com/rust-lang/cargo" diff --git a/benches/capture/Cargo.toml b/benches/capture/Cargo.toml index 9f529a57f..38d57b288 100644 --- a/benches/capture/Cargo.toml +++ b/benches/capture/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "capture" version = "0.1.0" -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" description = "Tool for capturing a real-world workspace for benchmarking." diff --git a/crates/cargo-platform/Cargo.toml b/crates/cargo-platform/Cargo.toml index 2b5e86e99..bba0ee4b1 100644 --- a/crates/cargo-platform/Cargo.toml +++ b/crates/cargo-platform/Cargo.toml @@ -2,7 +2,7 @@ name = "cargo-platform" version = "0.1.2" authors = ["The Cargo Project Developers"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" homepage = "https://github.com/rust-lang/cargo" repository = "https://github.com/rust-lang/cargo" diff --git a/crates/cargo-test-macro/Cargo.toml b/crates/cargo-test-macro/Cargo.toml index 7f204278b..6a20d4885 100644 --- a/crates/cargo-test-macro/Cargo.toml +++ b/crates/cargo-test-macro/Cargo.toml @@ -2,7 +2,7 @@ name = "cargo-test-macro" version = "0.1.0" authors = ["Jethro Beekman "] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" homepage = "https://github.com/rust-lang/cargo" repository = "https://github.com/rust-lang/cargo" diff --git a/crates/cargo-test-support/Cargo.toml b/crates/cargo-test-support/Cargo.toml index 7329441aa..d05d86b40 100644 --- a/crates/cargo-test-support/Cargo.toml +++ b/crates/cargo-test-support/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-test-support" version = "0.1.0" authors = ["Alex Crichton "] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" [lib] doctest = false diff --git a/crates/cargo-util/Cargo.toml b/crates/cargo-util/Cargo.toml index 65929472f..f0f3cceb5 100644 --- a/crates/cargo-util/Cargo.toml +++ b/crates/cargo-util/Cargo.toml @@ -2,7 +2,7 @@ name = "cargo-util" version = "0.1.1" authors = ["The Cargo Project Developers"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" homepage = "https://github.com/rust-lang/cargo" repository = "https://github.com/rust-lang/cargo" diff --git a/crates/crates-io/Cargo.toml b/crates/crates-io/Cargo.toml index e26ef236c..7fe05c98e 100644 --- a/crates/crates-io/Cargo.toml +++ b/crates/crates-io/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "crates-io" version = "0.33.0" -edition = "2018" +edition = "2021" authors = ["Alex Crichton "] license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/cargo" diff --git a/crates/credential/cargo-credential-1password/Cargo.toml b/crates/credential/cargo-credential-1password/Cargo.toml index c1d6a473f..423f6518a 100644 --- a/crates/credential/cargo-credential-1password/Cargo.toml +++ b/crates/credential/cargo-credential-1password/Cargo.toml @@ -2,7 +2,7 @@ name = "cargo-credential-1password" version = "0.1.0" authors = ["The Rust Project Developers"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/cargo" description = "A Cargo credential process that stores tokens in a 1password vault." diff --git a/crates/credential/cargo-credential-gnome-secret/Cargo.toml b/crates/credential/cargo-credential-gnome-secret/Cargo.toml index dc91be2e4..d84c8b80d 100644 --- a/crates/credential/cargo-credential-gnome-secret/Cargo.toml +++ b/crates/credential/cargo-credential-gnome-secret/Cargo.toml @@ -2,7 +2,7 @@ name = "cargo-credential-gnome-secret" version = "0.1.0" authors = ["The Rust Project Developers"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/cargo" description = "A Cargo credential process that stores tokens with GNOME libsecret." diff --git a/crates/credential/cargo-credential-macos-keychain/Cargo.toml b/crates/credential/cargo-credential-macos-keychain/Cargo.toml index d0875db99..0cdb8dff5 100644 --- a/crates/credential/cargo-credential-macos-keychain/Cargo.toml +++ b/crates/credential/cargo-credential-macos-keychain/Cargo.toml @@ -2,7 +2,7 @@ name = "cargo-credential-macos-keychain" version = "0.1.0" authors = ["The Rust Project Developers"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/cargo" description = "A Cargo credential process that stores tokens in a macOS keychain." diff --git a/crates/credential/cargo-credential-wincred/Cargo.toml b/crates/credential/cargo-credential-wincred/Cargo.toml index 654344d60..41a45e690 100644 --- a/crates/credential/cargo-credential-wincred/Cargo.toml +++ b/crates/credential/cargo-credential-wincred/Cargo.toml @@ -2,7 +2,7 @@ name = "cargo-credential-wincred" version = "0.1.0" authors = ["The Rust Project Developers"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/cargo" description = "A Cargo credential process that stores tokens with Windows Credential Manager." diff --git a/crates/credential/cargo-credential/Cargo.toml b/crates/credential/cargo-credential/Cargo.toml index 0a26160ff..435e10b92 100644 --- a/crates/credential/cargo-credential/Cargo.toml +++ b/crates/credential/cargo-credential/Cargo.toml @@ -2,7 +2,7 @@ name = "cargo-credential" version = "0.1.0" authors = ["The Rust Project Developers"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/cargo" description = "A library to assist writing Cargo credential helpers." diff --git a/crates/mdman/Cargo.toml b/crates/mdman/Cargo.toml index 4f17666b8..0536d1768 100644 --- a/crates/mdman/Cargo.toml +++ b/crates/mdman/Cargo.toml @@ -2,7 +2,7 @@ name = "mdman" version = "0.1.0" authors = ["Eric Huss"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" description = "Creates a man page page from markdown." diff --git a/src/doc/semver-check/Cargo.toml b/src/doc/semver-check/Cargo.toml index bf77dfabb..bdfd8d7d7 100644 --- a/src/doc/semver-check/Cargo.toml +++ b/src/doc/semver-check/Cargo.toml @@ -2,7 +2,7 @@ name = "semver-check" version = "0.1.0" authors = ["Eric Huss"] -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/doc/src/getting-started/first-steps.md b/src/doc/src/getting-started/first-steps.md index 377e0e4da..15bb4bdc7 100644 --- a/src/doc/src/getting-started/first-steps.md +++ b/src/doc/src/getting-started/first-steps.md @@ -33,7 +33,7 @@ This is all we need to get started. First, let’s check out `Cargo.toml`: [package] name = "hello_world" version = "0.1.0" -edition = "2018" +edition = "2021" [dependencies] ``` diff --git a/src/doc/src/guide/creating-a-new-project.md b/src/doc/src/guide/creating-a-new-project.md index 5ac22a2f2..e0daefc6b 100644 --- a/src/doc/src/guide/creating-a-new-project.md +++ b/src/doc/src/guide/creating-a-new-project.md @@ -29,7 +29,7 @@ Let’s take a closer look at `Cargo.toml`: [package] name = "hello_world" version = "0.1.0" -edition = "2018" +edition = "2021" [dependencies] diff --git a/src/doc/src/guide/dependencies.md b/src/doc/src/guide/dependencies.md index ff86900d4..a47f747e4 100644 --- a/src/doc/src/guide/dependencies.md +++ b/src/doc/src/guide/dependencies.md @@ -35,7 +35,7 @@ crates: [package] name = "hello_world" version = "0.1.0" -edition = "2018" +edition = "2021" [dependencies] time = "0.1.12" diff --git a/src/doc/src/reference/build-script-examples.md b/src/doc/src/reference/build-script-examples.md index 03eb9213a..0db3bf726 100644 --- a/src/doc/src/reference/build-script-examples.md +++ b/src/doc/src/reference/build-script-examples.md @@ -147,7 +147,7 @@ Pretty similar to before! Next, the manifest: [package] name = "hello-world-from-c" version = "0.1.0" -edition = "2018" +edition = "2021" ``` For now we’re not going to use any build dependencies, so let’s take a look at @@ -297,7 +297,7 @@ with `pkg-config` installed. Let's start by setting up the manifest: [package] name = "libz-sys" version = "0.1.0" -edition = "2018" +edition = "2021" links = "z" [build-dependencies] @@ -384,7 +384,7 @@ Here's an example: [package] name = "zuser" version = "0.1.0" -edition = "2018" +edition = "2021" [dependencies] libz-sys = "1.0.25" From c687d83ada538b757cb0b27c12937cc0ad76e503 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 22 Oct 2021 10:27:20 -0700 Subject: [PATCH 2/4] Remove `authors` directives from Cargo crates Most of these are pretty dated and Cargo defaults nowadays to not emitting an `authors` field so this commit also removes them from the manifests. --- Cargo.toml | 3 --- crates/cargo-platform/Cargo.toml | 1 - crates/cargo-test-macro/Cargo.toml | 1 - crates/cargo-test-support/Cargo.toml | 1 - crates/cargo-util/Cargo.toml | 1 - crates/crates-io/Cargo.toml | 1 - crates/credential/cargo-credential-1password/Cargo.toml | 1 - crates/credential/cargo-credential-gnome-secret/Cargo.toml | 1 - crates/credential/cargo-credential-macos-keychain/Cargo.toml | 1 - crates/credential/cargo-credential-wincred/Cargo.toml | 1 - crates/credential/cargo-credential/Cargo.toml | 1 - crates/mdman/Cargo.toml | 1 - crates/resolver-tests/Cargo.toml | 1 - 13 files changed, 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 023a63b45..b906a8cd2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,9 +2,6 @@ name = "cargo" version = "0.59.0" edition = "2021" -authors = ["Yehuda Katz ", - "Carl Lerche ", - "Alex Crichton "] license = "MIT OR Apache-2.0" homepage = "https://crates.io" repository = "https://github.com/rust-lang/cargo" diff --git a/crates/cargo-platform/Cargo.toml b/crates/cargo-platform/Cargo.toml index bba0ee4b1..9a3117012 100644 --- a/crates/cargo-platform/Cargo.toml +++ b/crates/cargo-platform/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "cargo-platform" version = "0.1.2" -authors = ["The Cargo Project Developers"] edition = "2021" license = "MIT OR Apache-2.0" homepage = "https://github.com/rust-lang/cargo" diff --git a/crates/cargo-test-macro/Cargo.toml b/crates/cargo-test-macro/Cargo.toml index 6a20d4885..04dafc028 100644 --- a/crates/cargo-test-macro/Cargo.toml +++ b/crates/cargo-test-macro/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "cargo-test-macro" version = "0.1.0" -authors = ["Jethro Beekman "] edition = "2021" license = "MIT OR Apache-2.0" homepage = "https://github.com/rust-lang/cargo" diff --git a/crates/cargo-test-support/Cargo.toml b/crates/cargo-test-support/Cargo.toml index d05d86b40..f704dd5a3 100644 --- a/crates/cargo-test-support/Cargo.toml +++ b/crates/cargo-test-support/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "cargo-test-support" version = "0.1.0" -authors = ["Alex Crichton "] license = "MIT OR Apache-2.0" edition = "2021" diff --git a/crates/cargo-util/Cargo.toml b/crates/cargo-util/Cargo.toml index f0f3cceb5..d8fa1041f 100644 --- a/crates/cargo-util/Cargo.toml +++ b/crates/cargo-util/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "cargo-util" version = "0.1.1" -authors = ["The Cargo Project Developers"] edition = "2021" license = "MIT OR Apache-2.0" homepage = "https://github.com/rust-lang/cargo" diff --git a/crates/crates-io/Cargo.toml b/crates/crates-io/Cargo.toml index 7fe05c98e..90d060449 100644 --- a/crates/crates-io/Cargo.toml +++ b/crates/crates-io/Cargo.toml @@ -2,7 +2,6 @@ name = "crates-io" version = "0.33.0" edition = "2021" -authors = ["Alex Crichton "] license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/cargo" description = """ diff --git a/crates/credential/cargo-credential-1password/Cargo.toml b/crates/credential/cargo-credential-1password/Cargo.toml index 423f6518a..6d24ccdc6 100644 --- a/crates/credential/cargo-credential-1password/Cargo.toml +++ b/crates/credential/cargo-credential-1password/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "cargo-credential-1password" version = "0.1.0" -authors = ["The Rust Project Developers"] edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/cargo" diff --git a/crates/credential/cargo-credential-gnome-secret/Cargo.toml b/crates/credential/cargo-credential-gnome-secret/Cargo.toml index d84c8b80d..bfa073479 100644 --- a/crates/credential/cargo-credential-gnome-secret/Cargo.toml +++ b/crates/credential/cargo-credential-gnome-secret/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "cargo-credential-gnome-secret" version = "0.1.0" -authors = ["The Rust Project Developers"] edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/cargo" diff --git a/crates/credential/cargo-credential-macos-keychain/Cargo.toml b/crates/credential/cargo-credential-macos-keychain/Cargo.toml index 0cdb8dff5..8b78c34bc 100644 --- a/crates/credential/cargo-credential-macos-keychain/Cargo.toml +++ b/crates/credential/cargo-credential-macos-keychain/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "cargo-credential-macos-keychain" version = "0.1.0" -authors = ["The Rust Project Developers"] edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/cargo" diff --git a/crates/credential/cargo-credential-wincred/Cargo.toml b/crates/credential/cargo-credential-wincred/Cargo.toml index 41a45e690..4711fb788 100644 --- a/crates/credential/cargo-credential-wincred/Cargo.toml +++ b/crates/credential/cargo-credential-wincred/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "cargo-credential-wincred" version = "0.1.0" -authors = ["The Rust Project Developers"] edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/cargo" diff --git a/crates/credential/cargo-credential/Cargo.toml b/crates/credential/cargo-credential/Cargo.toml index 435e10b92..6821fa8ed 100644 --- a/crates/credential/cargo-credential/Cargo.toml +++ b/crates/credential/cargo-credential/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "cargo-credential" version = "0.1.0" -authors = ["The Rust Project Developers"] edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/cargo" diff --git a/crates/mdman/Cargo.toml b/crates/mdman/Cargo.toml index 0536d1768..bae299f45 100644 --- a/crates/mdman/Cargo.toml +++ b/crates/mdman/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "mdman" version = "0.1.0" -authors = ["Eric Huss"] edition = "2021" license = "MIT OR Apache-2.0" description = "Creates a man page page from markdown." diff --git a/crates/resolver-tests/Cargo.toml b/crates/resolver-tests/Cargo.toml index 5a9924107..23bb6000a 100644 --- a/crates/resolver-tests/Cargo.toml +++ b/crates/resolver-tests/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "resolver-tests" version = "0.1.0" -authors = ["Alex Crichton "] edition = "2018" [dependencies] From ac69b0550092642e9d99607ebe3a5a8c052bd71c Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 22 Oct 2021 10:33:46 -0700 Subject: [PATCH 3/4] Update stable rust in the docs CI builder --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c9eb51210..1443b7681 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -113,6 +113,7 @@ jobs: steps: - uses: actions/checkout@v2 - run: rustup update nightly && rustup default nightly + - run: rustup update stable - run: rustup component add rust-docs - run: ci/validate-man.sh # This requires rustfmt, use stable. From cab1e3566b10402b26469f5afd77f8f98ad979ca Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 22 Oct 2021 13:30:46 -0700 Subject: [PATCH 4/4] Fix CI testing --- .github/workflows/main.yml | 4 +++- crates/cargo-test-support/Cargo.toml | 3 +++ crates/cargo-test-support/src/lib.rs | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1443b7681..d4c84b7bf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,7 +68,9 @@ jobs: # Deny warnings on CI to avoid warnings getting into the codebase. - run: cargo test --features 'deny-warnings' - - run: cargo test --features 'deny-warnings' -p cargo-test-support + - run: cargo test --features 'deny-warnings' --manifest-path crates/cargo-test-support/Cargo.toml + env: + CARGO_TARGET_DIR: target - run: cargo test -p cargo-platform - run: cargo test -p cargo-util - run: cargo test --manifest-path crates/mdman/Cargo.toml diff --git a/crates/cargo-test-support/Cargo.toml b/crates/cargo-test-support/Cargo.toml index f704dd5a3..7d57d9f02 100644 --- a/crates/cargo-test-support/Cargo.toml +++ b/crates/cargo-test-support/Cargo.toml @@ -23,3 +23,6 @@ tar = { version = "0.4.18", default-features = false } termcolor = "1.1.2" toml = "0.5.7" url = "2.2.2" + +[features] +deny-warnings = [] diff --git a/crates/cargo-test-support/src/lib.rs b/crates/cargo-test-support/src/lib.rs index 36fa9d2da..f8e34ed89 100644 --- a/crates/cargo-test-support/src/lib.rs +++ b/crates/cargo-test-support/src/lib.rs @@ -5,6 +5,7 @@ #![allow(clippy::all)] #![warn(clippy::needless_borrow)] #![warn(clippy::redundant_clone)] +#![cfg_attr(feature = "deny-warnings", deny(warnings))] use std::env; use std::ffi::OsStr;