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

Update MSRV to 1.66.1 #2468

Merged
merged 16 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
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/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,10 +29,10 @@ 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(),
)
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
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#

# Rust MSRV (entered into the generated README)
rust.msrv=1.63.0
rust.msrv=1.66.1

# To enable debug, swap out the two lines below.
# When changing this value, be sure to run `./gradlew --stop` to kill the Gradle daemon.
Expand Down
10 changes: 5 additions & 5 deletions rust-runtime/aws-smithy-checksums/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ impl ChecksumAlgorithm {
/// Return the `HttpChecksum` implementor for this algorithm
pub fn into_impl(self) -> Box<dyn http::HttpChecksum> {
match self {
Self::Crc32 => Box::new(Crc32::default()),
Self::Crc32c => Box::new(Crc32c::default()),
Self::Md5 => Box::new(Md5::default()),
Self::Sha1 => Box::new(Sha1::default()),
Self::Sha256 => Box::new(Sha256::default()),
Self::Crc32 => Box::<Crc32>::default(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol thanks clippy but that is definitely not better

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm getting a bit annoyed at Clippy. The last few MSRV updates have introduced some really pedantic lints.

Self::Crc32c => Box::<Crc32c>::default(),
Self::Md5 => Box::<Md5>::default(),
Self::Sha1 => Box::<Sha1>::default(),
Self::Sha256 => Box::<Sha256>::default(),
}
}

Expand Down
8 changes: 4 additions & 4 deletions rust-runtime/aws-smithy-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ where
);
let (mut req, parts) = op.into_request_response();
if let Some(metadata) = &parts.metadata {
span.record("operation", &metadata.name());
span.record("service", &metadata.service());
span.record("operation", metadata.name());
span.record("service", metadata.service());
// This will clone two `Cow::<&'static str>::Borrow`s in the vast majority of cases
req.properties_mut().insert(metadata.clone());
}
Expand All @@ -218,12 +218,12 @@ where
.await;
match &result {
Ok(_) => {
span.record("status", &"ok");
span.record("status", "ok");
}
Err(err) => {
span.record(
"status",
&match err {
match err {
SdkError::ConstructionFailure(_) => "construction_failure",
SdkError::DispatchFailure(_) => "dispatch_failure",
SdkError::ResponseError(_) => "response_error",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ async def handler(bytestream):
}

fn streaming_bytestream_from_vec(chunks: Vec<&'static str>) -> ByteStream {
let stream = stream::iter(chunks.into_iter().map(|v| Ok::<_, io::Error>(v)));
let stream = stream::iter(chunks.into_iter().map(Ok::<_, io::Error>));
let body = Body::wrap_stream(stream);
ByteStream::new(SdkBody::from(body))
}
4 changes: 3 additions & 1 deletion rust-runtime/aws-smithy-http-server/src/protocols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use http::HeaderMap;

/// When there are no modeled inputs,
/// a request body is empty and the content-type request header must not be set
#[allow(clippy::result_large_err)]
pub fn content_type_header_empty_body_no_modeled_input(headers: &HeaderMap) -> Result<(), MissingContentTypeReason> {
if headers.contains_key(http::header::CONTENT_TYPE) {
let found_mime = parse_content_type(headers)?;
Expand All @@ -21,6 +22,7 @@ pub fn content_type_header_empty_body_no_modeled_input(headers: &HeaderMap) -> R
}
}

#[allow(clippy::result_large_err)]
Velfi marked this conversation as resolved.
Show resolved Hide resolved
fn parse_content_type(headers: &HeaderMap) -> Result<mime::Mime, MissingContentTypeReason> {
headers
.get(http::header::CONTENT_TYPE)
Expand All @@ -32,7 +34,7 @@ fn parse_content_type(headers: &HeaderMap) -> Result<mime::Mime, MissingContentT
}

/// Checks that the content-type in request headers is valid
#[allow(deprecated)]
#[allow(deprecated, clippy::result_large_err)]
pub fn content_type_header_classifier(
headers: &HeaderMap,
expected_content_type: Option<&'static str>,
Expand Down
4 changes: 2 additions & 2 deletions rust-runtime/aws-smithy-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pin-utils = "0.1.0"
tracing = "0.1"

# We are using hyper for our streaming body implementation, but this is an internal detail.
hyper = "0.14.12"
hyper = "0.14.25"

# ByteStream internals
futures-core = "0.3.14"
Expand All @@ -38,7 +38,7 @@ tokio-util = { version = "0.7", optional = true }
[dev-dependencies]
async-stream = "0.3"
futures-util = "0.3"
hyper = { version = "0.14.12", features = ["stream"] }
hyper = { version = "0.14.25", features = ["stream"] }
pretty_assertions = "1.3"
proptest = "1"
tokio = { version = "1.8.4", features = [
Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-http/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ mod test {
proptest! {
#[test]
fn test_encode_request(s: String) {
let _: Uri = format!("http://host.example.com/?{}", fmt_string(&s)).parse().expect("all strings should be encoded properly");
let _: Uri = format!("http://host.example.com/?{}", fmt_string(s)).parse().expect("all strings should be encoded properly");
}
}
}
12 changes: 6 additions & 6 deletions rust-runtime/aws-smithy-protocol-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,11 @@ mod tests {
fn test_validate_json_body() {
let expected = r#"{"abc": 5 }"#;
let actual = r#" {"abc": 5 }"#;
validate_body(&actual, expected, MediaType::Json).expect("inputs matched as JSON");
validate_body(actual, expected, MediaType::Json).expect("inputs matched as JSON");

let expected = r#"{"abc": 5 }"#;
let actual = r#" {"abc": 6 }"#;
validate_body(&actual, expected, MediaType::Json).expect_err("bodies do not match");
validate_body(actual, expected, MediaType::Json).expect_err("bodies do not match");
}

#[test]
Expand All @@ -501,22 +501,22 @@ mod tests {
hello123
</a>"#;
let actual = "<a>hello123</a>";
validate_body(&actual, expected, MediaType::Xml).expect("inputs match as XML");
validate_body(actual, expected, MediaType::Xml).expect("inputs match as XML");
let expected = r#"<a>
hello123
</a>"#;
let actual = "<a>hello124</a>";
validate_body(&actual, expected, MediaType::Xml).expect_err("inputs are different");
validate_body(actual, expected, MediaType::Xml).expect_err("inputs are different");
}

#[test]
fn test_validate_non_json_body() {
let expected = r#"asdf"#;
let actual = r#"asdf "#;
validate_body(&actual, expected, MediaType::from("something/else"))
validate_body(actual, expected, MediaType::from("something/else"))
.expect_err("bodies do not match");

validate_body(&expected, expected, MediaType::from("something/else"))
validate_body(expected, expected, MediaType::from("something/else"))
.expect("inputs matched exactly")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ impl Token for Standard {
}

fn forget(self) {
match self.permit {
Some(permit) => permit.forget(),
None => (),
if let Some(permit) = self.permit {
permit.forget()
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-types/src/date_time/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ pub(crate) mod http_date {
let mut out = String::with_capacity(32);
fn push_digit(out: &mut String, digit: u8) {
debug_assert!(digit < 10);
out.push((b'0' + digit as u8) as char);
out.push((b'0' + digit) as char);
}

out.push_str(weekday);
Expand Down
Loading