Skip to content

Commit

Permalink
Update MSRV to 1.66.1 (#2468)
Browse files Browse the repository at this point in the history
* update: MSRV to 1.66.1

* add: CHANGELOG.next.toml entry

* update: Dockerfile too

* fix: clippy lints

* fix: sigv4 event_stream.rs clippy lint
update: codegen clippy lint allowlist

* fix: doc lint that's nightly only
add: docs for aws-smithy-http
add: docs for aws-smithy-client
add: docs for aws-smithy-async

* add: more missing docs.

* fix: add more missing docs

* remove: unnecessary & in HttpBindingGenerator
fix: lint name

* fix: another doc import

* fix: test broken by changing compiler error

* fix: even more lints\nadd: lint warns to all smithy runtime crates

* fix: broken doc links

* fix: clippy bug

* fix: don't use modules named lib in codegen tests

* fix: the paginator_canary.rs unnecessary cast
  • Loading branch information
Velfi authored Mar 16, 2023
1 parent bde362e commit 92952cb
Show file tree
Hide file tree
Showing 103 changed files with 479 additions and 305 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
required: false

env:
rust_version: 1.63.0
rust_version: 1.66.1
rust_toolchain_components: clippy,rustfmt
ENCRYPTED_DOCKER_PASSWORD: ${{ secrets.ENCRYPTED_DOCKER_PASSWORD }}
DOCKER_LOGIN_TOKEN_PASSPHRASE: ${{ secrets.DOCKER_LOGIN_TOKEN_PASSPHRASE }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/claim-crate-names.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
cancel-in-progress: true

env:
rust_version: 1.63.0
rust_version: 1.66.1

name: Claim unpublished crate names on crates.io
run-name: ${{ github.workflow }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ concurrency:

env:
java_version: 11
rust_version: 1.63.0
rust_version: 1.66.1
rust_toolchain_components: clippy,rustfmt
apt_dependencies: libssl-dev gnuplot jq

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
cancel-in-progress: true

env:
rust_version: 1.63.0
rust_version: 1.66.1

name: Release smithy-rs
run-name: ${{ github.workflow }} ${{ inputs.semantic_version }} (${{ inputs.commit_sha }}) - ${{ inputs.dry_run && 'Dry run' || 'Production run' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-sdk-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.63.0
toolchain: 1.66.1
- name: Delete old SDK
run: |
- name: Generate a fresh SDK
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,15 @@ be reused.
references = ["aws-sdk-rust#160", "smithy-rs#2445"]
meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client" }
author = "rcoh"

[[aws-sdk-rust]]
message = "Update MSRV to 1.66.1"
references = ["smithy-rs#2467"]
meta = { "breaking" = true, "tada" = true, "bug" = false }
author = "Velfi"

[[smithy-rs]]
message = "Update MSRV to 1.66.1"
references = ["smithy-rs#2467"]
meta = { "breaking" = true, "tada" = true, "bug" = false, "target" = "all" }
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 @@ -28,7 +28,7 @@ aws-smithy-http-tower = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-http-to
aws-smithy-json = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-json" }
aws-smithy-types = { path = "../../sdk/build/aws-sdk/sdk/aws-smithy-types" }
aws-types = { path = "../../sdk/build/aws-sdk/sdk/aws-types" }
hyper = { version = "0.14.12", default-features = false }
hyper = { version = "0.14.25", default-features = false }
time = { version = "0.3.4", features = ["parsing"] }
tokio = { version = "1.13.1", features = ["sync"] }
tracing = { version = "0.1" }
Expand Down
5 changes: 2 additions & 3 deletions aws/rust-runtime/aws-config/src/imds/credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,10 @@ mod test {
sleeper.sleep(std::time::Duration::from_millis(100)),
);
match timeout.await {
Ok(_) => assert!(false, "provide_credentials completed before timeout future"),
Ok(_) => panic!("provide_credentials completed before timeout future"),
Err(_err) => match provider.fallback_on_interrupt() {
Some(actual) => assert_eq!(actual, expected),
None => assert!(
false,
None => panic!(
"provide_credentials timed out and no credentials returned from fallback_on_interrupt"
),
},
Expand Down
10 changes: 4 additions & 6 deletions aws/rust-runtime/aws-config/src/meta/credentials/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,10 @@ mod tests {
tokio::time::sleep(Duration::from_millis(300)),
);
match timeout.await {
Ok(_) => assert!(false, "provide_credentials completed before timeout future"),
Ok(_) => panic!("provide_credentials completed before timeout future"),
Err(_err) => match chain.fallback_on_interrupt() {
Some(actual) => assert_eq!(actual, expected),
None => assert!(
false,
None => panic!(
"provide_credentials timed out and no credentials returned from fallback_on_interrupt"
),
},
Expand Down Expand Up @@ -208,11 +207,10 @@ mod tests {
tokio::time::sleep(Duration::from_millis(100)),
);
match timeout.await {
Ok(_) => assert!(false, "provide_credentials completed before timeout future"),
Ok(_) => panic!("provide_credentials completed before timeout future"),
Err(_err) => match chain.fallback_on_interrupt() {
Some(actual) => assert_eq!(actual, expected),
None => assert!(
false,
None => panic!(
"provide_credentials timed out and no credentials returned from fallback_on_interrupt"
),
},
Expand Down
8 changes: 4 additions & 4 deletions aws/rust-runtime/aws-config/src/profile/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,14 @@ mod test {
fn flatten(profile: ProfileSet) -> HashMap<String, HashMap<String, String>> {
profile
.profiles
.into_iter()
.map(|(_name, profile)| {
.into_values()
.map(|profile| {
(
profile.name,
profile
.properties
.into_iter()
.map(|(_, prop)| (prop.key, prop.value))
.into_values()
.map(|prop| (prop.key, prop.value))
.collect(),
)
})
Expand Down
6 changes: 3 additions & 3 deletions aws/rust-runtime/aws-config/src/profile/parser/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ mod tests {
// ~ is only expanded as a single component (currently)
let path = "~aws/config";
assert_eq!(
expand_home(&path, false, &None).to_str().unwrap(),
expand_home(path, false, &None).to_str().unwrap(),
"~aws/config"
);
}
Expand Down Expand Up @@ -336,7 +336,7 @@ mod tests {
fn test_expand_home() {
let path = "~/.aws/config";
assert_eq!(
expand_home(&path, false, &Some("/user/foo".to_string()))
expand_home(path, false, &Some("/user/foo".to_string()))
.to_str()
.unwrap(),
"/user/foo/.aws/config"
Expand Down Expand Up @@ -366,7 +366,7 @@ mod tests {
fn test_expand_home_windows() {
let path = "~/.aws/config";
assert_eq!(
expand_home(&path, true, &Some("C:\\Users\\name".to_string()),)
expand_home(path, true, &Some("C:\\Users\\name".to_string()),)
.to_str()
.unwrap(),
"C:\\Users\\name\\.aws\\config"
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-sigv4/src/event_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fn calculate_string_to_sign(
let mut date_buffer = Vec::new();
write_headers_to(&[date_header], &mut date_buffer).unwrap();
writeln!(sts, "{}", sha256_hex_string(&date_buffer)).unwrap();
write!(sts, "{}", sha256_hex_string(&message_payload)).unwrap();
write!(sts, "{}", sha256_hex_string(message_payload)).unwrap();
sts
}

Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-sigv4/src/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ mod tests {
#[test]
fn sign_payload_empty_string() {
let expected = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
let actual = sha256_hex_string(&[]);
let actual = sha256_hex_string([]);
assert_eq!(expected, actual);
}
}
4 changes: 2 additions & 2 deletions aws/rust-runtime/aws-types/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use std::path::Path;

fn generate_build_vars(output_path: &Path) {
let rust_version = rustc_version::version().expect("Could not retrieve rustc version");
let mut f = File::create(&output_path.join("build_env.rs"))
.expect("Could not create build environment");
let mut f =
File::create(output_path.join("build_env.rs")).expect("Could not create build environment");
f.write_all(format!("const RUST_VERSION: &str = \"{}\";", rust_version).as_bytes())
.expect("Unable to write rust version");
f.flush().expect("failed to flush");
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 @@ -30,7 +30,7 @@ futures-util = "0.3.25"
hdrhistogram = "7.5.2"
http = "0.2.3"
http-body = "0.4.5"
hyper = "0.14.12"
hyper = "0.14.25"
serde_json = "1"
smol = "1.2"
tempfile = "3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async fn list_buckets() -> Result<(), aws_sdk_s3::Error> {
#[should_panic = "error: package ID specification `rustls` did not match any packages"]
fn test_rustls_is_not_in_dependency_tree() {
let cargo_location = std::env::var("CARGO").unwrap();
let cargo_command = std::process::Command::new(&cargo_location)
let cargo_command = std::process::Command::new(cargo_location)
.arg("tree")
.arg("--invert")
.arg("rustls")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ class ClientEnumGeneratorTest {
"matching_on_enum_should_be_forward_compatible",
"""
match $enumToMatchOn {
SomeEnum::Variant1 => assert!(false, "expected `Variant3` but got `Variant1`"),
SomeEnum::Variant2 => assert!(false, "expected `Variant3` but got `Variant2`"),
other @ _ if other.as_str() == "Variant3" => assert!(true),
_ => assert!(false, "expected `Variant3` but got `_`"),
SomeEnum::Variant1 => panic!("expected `Variant3` but got `Variant1`"),
SomeEnum::Variant2 => panic!("expected `Variant3` but got `Variant2`"),
other @ _ if other.as_str() == "Variant3" => {},
_ => panic!("expected `Variant3` but got `_`"),
}
""".trimIndent(),
""",
)
}
project.compileAndTest()
Expand Down Expand Up @@ -120,7 +120,7 @@ class ClientEnumGeneratorTest {
assert_eq!(SomeEnum::from("Unknown"), SomeEnum::UnknownValue);
assert_eq!(SomeEnum::from("UnknownValue"), SomeEnum::UnknownValue_);
assert_eq!(SomeEnum::from("SomethingNew"), SomeEnum::Unknown(crate::primitives::UnknownVariantValue("SomethingNew".to_owned())));
""".trimIndent(),
""",
)
}
project.compileAndTest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private val allowedClippyLints = listOf(
// Sometimes operations are named the same as our module e.g. output leading to `output::output`.
"module_inception",

// Currently, we don't recase acronyms in models, e.g. `SSEVersion`.
// Currently, we don't re-case acronyms in models, e.g. `SSEVersion`.
"upper_case_acronyms",

// Large errors trigger this warning, we are unlikely to optimize this case currently.
Expand All @@ -34,9 +34,7 @@ private val allowedClippyLints = listOf(
"should_implement_trait",

// Protocol tests use silly names like `baz`, don't flag that.
// TODO(msrv_upgrade): switch upon MSRV upgrade to Rust 1.65
"blacklisted_name",
// "disallowed_names",
"disallowed_names",

// Forcing use of `vec![]` can make codegen harder in some cases.
"vec_init_then_push",
Expand All @@ -51,8 +49,7 @@ private val allowedClippyLints = listOf(
"derive_partial_eq_without_eq",

// Keeping errors small in a backwards compatible way is challenging
// TODO(msrv_upgrade): uncomment upon MSRV upgrade to Rust 1.65
// "result_large_err",
"result_large_err",
)

private val allowedRustdocLints = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ class HttpBindingGenerator(
target.isStringShape -> {
if (target.hasTrait<MediaTypeTrait>()) {
val func = writer.format(RuntimeType.base64Encode(runtimeConfig))
"$func(&$targetName)"
"$func($targetName)"
} else {
quoteValue("$targetName.as_str()")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ object TestWorkspace {
// help rust select the right version when we run cargo test
// TODO(https://github.com/awslabs/smithy-rs/issues/2048): load this from the msrv property using a
// method as we do for runtime crate versions
"[toolchain]\nchannel = \"1.63.0\"\n",
"[toolchain]\nchannel = \"1.66.1\"\n",
)
// ensure there at least an empty lib.rs file to avoid broken crates
newProject.resolve("src").mkdirs()
Expand Down
Loading

0 comments on commit 92952cb

Please sign in to comment.