Skip to content

Commit

Permalink
Update to Rust Edition 2021 (#1268)
Browse files Browse the repository at this point in the history
* update: set rust edition to 2021
update: strict param of intoCrate to set clippy to set #![deny(clippy::all)]

* add: changelog entry
  • Loading branch information
Velfi authored Mar 22, 2022
1 parent 85cf8d3 commit b2c9896
Show file tree
Hide file tree
Showing 48 changed files with 68 additions and 48 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,15 @@ message = "Fix link to Developer Guide in crate's README.md"
references = ["smithy-rs#1262"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "liubin"

[[smithy-rs]]
message = "Update all runtime crates to [edition 2021](https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html)"
references = ["smithy-rs#1154"]
meta = { "breaking" = true, "tada" = false, "bug" = false }
author = "Velfi"

[[aws-sdk-rust]]
message = "Update all SDK and runtime crates to [edition 2021](https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html)"
references = ["smithy-rs#1154"]
meta = { "breaking" = true, "tada" = false, "bug" = false }
author = "Velfi"
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-config"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"]
description = "AWS SDK config and credential provider implementations."
edition = "2018"
edition = "2021"
exclude = ["test-data/*", "integration-tests/*"]
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-config/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name = "aws-types-fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
edition = "2018"
edition = "2021"

[package.metadata]
cargo-fuzz = true
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-endpoint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-endpoint"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"]
description = "AWS SDK endpoint support."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-http"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"]
description = "HTTP specific AWS SDK behaviors."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-hyper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-hyper"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"]
description = "This crate has been removed and is deprecated."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-inlineable/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description = """
The modules of this crate are intended to be inlined directly into the SDK as needed. The dependencies here
are to allow this crate to be compilable and testable in isolation, no client code actually takes these dependencies.
"""
edition = "2018"
edition = "2021"
license = "Apache-2.0"
publish = false
repository = "https://github.com/awslabs/smithy-rs"
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-sig-auth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-sig-auth"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"]
description = "SigV4 signing middleware for the AWS SDK."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-sigv4/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-sigv4"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "David Barsky <[email protected]>"]
description = "SigV4 signer for HTTP requests and Event Stream messages."
edition = "2018"
edition = "2021"
exclude = ["aws-sig-v4-test-suite/*"]
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-types"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"]
description = "Cross-service types for the AWS SDK."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

Expand Down
2 changes: 1 addition & 1 deletion aws/sdk/integration-tests/dynamodb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name = "dynamo-tests"
version = "0.1.0"
authors = ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"]
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 aws/sdk/integration-tests/ec2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ec2-tests"
version = "0.1.0"
edition = "2018"
edition = "2021"

[dev-dependencies]
aws-sdk-ec2 = { path = "../../build/aws-sdk/sdk/ec2" }
Expand Down
2 changes: 1 addition & 1 deletion aws/sdk/integration-tests/glacier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name = "glacier-tests"
version = "0.1.0"
authors = ["AWS Rust SDK Team <[email protected]>"]
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 aws/sdk/integration-tests/iam/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name = "iam-tests"
version = "0.1.0"
authors = ["AWS Rust SDK Team <[email protected]>"]
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 aws/sdk/integration-tests/kms/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name = "kms-tests"
version = "0.1.0"
authors = ["Russell Cohen <[email protected]>"]
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 aws/sdk/integration-tests/lambda/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "lambda"
version = "0.1.0"
authors = ["AWS Rust SDK Team <[email protected]>", "Zelda Hessler <[email protected]>"]
edition = "2018"
edition = "2021"

[dev-dependencies]
async-stream = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion aws/sdk/integration-tests/polly/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name = "polly-tests"
version = "0.1.0"
authors = ["John DiSanti <[email protected]>"]
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 aws/sdk/integration-tests/qldbsession/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name = "qldb-tests"
version = "0.1.0"
authors = ["Russell Cohen <[email protected]>", "Shing Lyu <[email protected]"]
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 aws/sdk/integration-tests/s3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name = "s3-tests"
version = "0.1.0"
authors = ["Russell Cohen <[email protected]>"]
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 aws/sdk/integration-tests/s3control/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name = "s3control"
version = "0.1.0"
authors = ["AWS Rust SDK Team <[email protected]>"]
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 aws/sdk/integration-tests/sts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name = "sts-tests"
version = "0.1.0"
authors = ["Russell Cohen <[email protected]>"]
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 aws/sdk/integration-tests/transcribestreaming/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "transcribestreaming"
version = "0.1.0"
authors = ["AWS Rust SDK Team <[email protected]>", "John DiSanti <[email protected]>"]
edition = "2018"
edition = "2021"

[dev-dependencies]
async-stream = "0.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ fun RustWriter.compileAndTest(
}
}

@JvmOverloads
private fun String.intoCrate(
deps: Set<CargoDependency>,
module: String? = null,
Expand All @@ -280,7 +279,7 @@ private fun String.intoCrate(
name = ${tempDir.nameWithoutExtension.dq()}
version = "0.0.1"
authors = ["[email protected]"]
edition = "2018"
edition = "2021"
[dependencies]
${deps.joinToString("\n") { it.toString() }}
Expand All @@ -300,6 +299,15 @@ private fun String.intoCrate(
""".trimIndent()
)
}

if (strict) {
mainRs.appendText(
"""
#![deny(clippy::all)]
""".trimIndent()
)
}

mainRs.appendText(
"""
pub mod $module;
Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-async/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-smithy-async"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "John DiSanti <[email protected]>"]
description = "Async runtime agnostic abstractions for smithy-rs."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-smithy-client"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"]
description = "Client for smithy-rs."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-eventstream/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-smithy-eventstream"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "John DiSanti <[email protected]>"]
description = "Event stream logic for smithy-rs."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-eventstream/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-smithy-eventstream-fuzz"
version = "0.1.0"
authors = ["AWS Rust SDK Team <[email protected]>", "John DiSanti <[email protected]>"]
publish = false
edition = "2018"
edition = "2021"

[package.metadata]
cargo-fuzz = true
Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-http-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "aws-smithy-http-server"
version = "0.0.0-smithy-rs-head"
authors = ["Smithy Rust Server <[email protected]>"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"
keywords = ["smithy", "framework", "web", "api", "aws"]
Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-http-server/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
edition = "2018"
edition = "2021"
max_width = 120
# Prevent carriage returns
newline_style = "Unix"
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-http-tower/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-smithy-http-tower"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"]
description = "Tower-compatible shims for smithy-rs middleware."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-smithy-http"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"]
description = "Smithy HTTP logic for smithy-rs."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-http/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-smithy-http-fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
edition = "2018"
edition = "2021"

[package.metadata]
cargo-fuzz = true
Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-json/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-smithy-json"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "John DiSanti <[email protected]>"]
description = "Token streaming JSON parser for smithy-rs."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-json/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-smithy-json-fuzz"
version = "0.0.0"
authors = ["AWS Rust SDK Team <[email protected]>", "John DiSanti <[email protected]>"]
publish = false
edition = "2018"
edition = "2021"

[package.metadata]
cargo-fuzz = true
Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-protocol-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-smithy-protocol-test"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"]
description = "A collection of library functions to validate HTTP requests against Smithy protocol tests."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-query/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-smithy-query"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "John DiSanti <[email protected]>"]
description = "AWSQuery and EC2Query Smithy protocol logic for smithy-rs."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-types-convert/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-smithy-types-convert"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>"]
description = "Conversion of types from aws-smithy-types to other libraries."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-smithy-types"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"]
description = "Types for smithy-rs codegen."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-types/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-smithy-types-fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
edition = "2018"
edition = "2021"

[package.metadata]
cargo-fuzz = true
Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-xml/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aws-smithy-xml"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"]
description = "XML parsing logic for Smithy protocols."
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/inlineable/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "inlineable"
version = "0.0.0-smithy-rs-head"
authors = ["AWS Rust SDK Team <[email protected]>", "Russell Cohen <[email protected]>"]
edition = "2018"
edition = "2021"
description = """
The modules of this crate are intended to be inlined directly into the SDK as needed. The dependencies here
are to allow this crate to be compilable and testable in isolation, no client code actually takes these dependencies.
Expand Down
Loading

0 comments on commit b2c9896

Please sign in to comment.