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

Upgrade Cargo to the 2021 edition #10000

Merged
merged 4 commits into from
Oct 23, 2021
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
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -113,6 +115,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.
Expand Down
5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
[package]
name = "cargo"
version = "0.59.0"
edition = "2018"
authors = ["Yehuda Katz <[email protected]>",
"Carl Lerche <[email protected]>",
"Alex Crichton <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
homepage = "https://crates.io"
repository = "https://github.com/rust-lang/cargo"
Expand Down
2 changes: 1 addition & 1 deletion benches/benchsuite/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion benches/capture/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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."

Expand Down
3 changes: 1 addition & 2 deletions crates/cargo-platform/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[package]
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"
Expand Down
3 changes: 1 addition & 2 deletions crates/cargo-test-macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[package]
name = "cargo-test-macro"
version = "0.1.0"
authors = ["Jethro Beekman <[email protected]>"]
edition = "2018"
edition = "2021"
license = "MIT OR Apache-2.0"
homepage = "https://github.com/rust-lang/cargo"
repository = "https://github.com/rust-lang/cargo"
Expand Down
6 changes: 4 additions & 2 deletions crates/cargo-test-support/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[package]
name = "cargo-test-support"
version = "0.1.0"
authors = ["Alex Crichton <[email protected]>"]
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"

[lib]
doctest = false
Expand All @@ -24,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 = []
1 change: 1 addition & 0 deletions crates/cargo-test-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions crates/cargo-util/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[package]
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"
Expand Down
3 changes: 1 addition & 2 deletions crates/crates-io/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[package]
name = "crates-io"
version = "0.33.0"
edition = "2018"
authors = ["Alex Crichton <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/cargo"
description = """
Expand Down
3 changes: 1 addition & 2 deletions crates/credential/cargo-credential-1password/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[package]
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."
Expand Down
3 changes: 1 addition & 2 deletions crates/credential/cargo-credential-gnome-secret/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[package]
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."
Expand Down
3 changes: 1 addition & 2 deletions crates/credential/cargo-credential-macos-keychain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[package]
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."
Expand Down
3 changes: 1 addition & 2 deletions crates/credential/cargo-credential-wincred/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[package]
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."
Expand Down
3 changes: 1 addition & 2 deletions crates/credential/cargo-credential/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[package]
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."
Expand Down
3 changes: 1 addition & 2 deletions crates/mdman/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[package]
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."

Expand Down
1 change: 0 additions & 1 deletion crates/resolver-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "resolver-tests"
version = "0.1.0"
authors = ["Alex Crichton <[email protected]>"]
edition = "2018"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/doc/semver-check/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/doc/src/getting-started/first-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
```
Expand Down
2 changes: 1 addition & 1 deletion src/doc/src/guide/creating-a-new-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion src/doc/src/guide/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ crates:
[package]
name = "hello_world"
version = "0.1.0"
edition = "2018"
edition = "2021"

[dependencies]
time = "0.1.12"
Expand Down
6 changes: 3 additions & 3 deletions src/doc/src/reference/build-script-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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"
Expand Down