Unverified Commit 80f6dd6c authored by AWS SDK Rust Bot's avatar AWS SDK Rust Bot Committed by GitHub
Browse files

Run `cargo update` on the runtime lockfiles and the SDK lockfile (#3896)

Updating lockfiles introduced `pin-project` `0.2.15`, which revealed [a
bug in
`cargo-check-external-types`](https://github.com/awslabs/cargo-check-external-types/pull/183).
This required `cargo-check-external-types` to release a new version with
a newer nightly version `nightly-2024-06-30`.

Switching to `nightly-2024-06-30` triggered a series of changes due to
the [automatic checking of cfg at compile
time](https://blog.rust-lang.org/2024/05/06/check-cfg.html). As a
result, the compiler has become stricter regarding unexpected `cfg` and
unused Cargo features in our codebase.

Most of the changes in this PR address these issues:
<details>
<summary>Expand to view the actual errors...</summary>

Ex.1
```
error: unexpected `cfg` condition name: `aws_sdk_unstable`
  --> aws-smithy-types/src/number.rs:29:13
   |
29 |         all(aws_sdk_unstable, feature = "serde-serialize")
   |             ^^^^^^^^^^^^^^^^
   |
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(aws_sdk_unstable)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(aws_sdk_unstable)");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
```
Ex.2
```
error: struct `ArrayIter` is never constructed
   --> aws-smithy-cbor/src/decode.rs:251:12
    |
251 | pub struct ArrayIter<'a, 'b, T> {
    |            ^^^^^^^^^
    |
    = note: `-D dead-code` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(dead_code)]`

error: struct `MapIter` is never constructed
   --> aws-smithy-cbor/src/decode.rs:266:12
    |
266 | pub struct MapIter<'a, 'b, K, V> {
    |            ^^^^^^^

error: could not compile `aws-smithy-cbor` (lib) due to 2 previous errors
```
Ex.3
```
error: for loop over a `&Option`. This is more readably written as an `if let` statement
   --> aws-smithy-runtime-api/src/client/runtime_components.rs:888:19
    |
888 |         validate!(&self.retry_strategy);
    |                   ^^^^^^^^^^^^^^^^^^^^
    |
help: to check pattern in a loop use `while let`
    |
871 |                 while let Some() =  in $field {
    |                 ~~~~~~~~~~~~~~~~~~
help: consider using `if let` to clear intent
    |
871 |                 if let Some() =  in $field {
    |                 ~~~~~~~~~~~~~~~

error: could not compile `aws-smithy-runtime-api` (lib) due to 4 previous errors
```
Ex.4
```
error: unexpected `cfg` condition name: `crypto_unstable`
   --> aws-smithy-experimental/src/hyper_1_0.rs:687:11
    |
687 |     #[cfg(crypto_unstable)]
    |           ^^^^^^^^^^^^^^^
    |
    = help: expected names are: `aws_sdk_unstable`, `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows`
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
             unexpected_cfgs = { level = "warn", check-cfg = ['cfg(crypto_unstable)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(crypto_unstable)");` to the top of the `build.rs`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
    = note: `-D unexpected-cfgs` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(unexpected_cfgs)]`
```
Ex.5
```
error: unexpected `cfg` condition value: `http-1x`
   --> aws-inlineable/src/presigning.rs:249:11
    |
249 |     #[cfg(feature = "http-1x")]
    |           ^^^^^^^^^^---------
    |                     |
    |                     help: there is a expected value with a similar name: `"http_1x"`
    |
    = note: expected values for `feature` are: `http_1x`
    = help: consider adding `http-1x` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

error: could not document `aws-inlineable`
```
Ex.6
```
error: unexpected `cfg` condition value: `gated-tests`
  --> sdk/s3/src/endpoint_lib/substring.rs:35:17
   |
35 | #[cfg(all(test, feature = "gated-tests"))]
   |                 ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `behavior-version-latest`, `default`, `http-1x`, `rt-tokio`, `rustls`, `sigv4a`, and `test-util`
   = help: consider adding `gated-tests` as a feature in `Cargo.toml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

error: could not compile `aws-sdk-s3` (lib) due to 2 previous errors
```
Ex.7
```
error: unexpected `cfg` condition value: `test-util`
   --> src/lib.rs:514:40
    |
514 |             #[cfg(all(feature = "sso", feature = "test-util"))]
    |                                        ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `allow-compilation`, `behavior-version-latest`, `client-hyper`, `credentials-process`, `default`, `rt-tokio`, `rustls`, and `sso`
    = help: consider adding `test-util` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html

> for more information about checking conditional configuration
    = note: `-D unexpected-cfgs` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(unexpected_cfgs)]`

error: could not compile `aws-config` (lib) due to 1 previous error
```
</details>

---------

Co-authored-by: default avatarysaito1001 <awsaito@amazon.com>
Co-authored-by: default avatarZelda Hessler <zhessler@amazon.com>
parent f648759e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ env:
  apt_dependencies: libssl-dev gnuplot jq
  java_version: 17
  rust_toolchain_components: clippy,rustfmt
  rust_nightly_version: nightly-2024-03-15
  rust_nightly_version: nightly-2024-06-30

jobs:
  generate-diff:
+27 −27
Original line number Diff line number Diff line
@@ -40,9 +40,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"

[[package]]
name = "anstyle"
version = "1.0.8"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1"
checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56"

[[package]]
name = "arbitrary"
@@ -69,7 +69,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd"
dependencies = [
 "proc-macro2",
 "quote",
 "syn 2.0.82",
 "syn 2.0.85",
]

[[package]]
@@ -317,7 +317,7 @@ dependencies = [

[[package]]
name = "aws-smithy-runtime-api"
version = "1.7.2"
version = "1.7.3"
dependencies = [
 "aws-smithy-async",
 "aws-smithy-types",
@@ -332,7 +332,7 @@ dependencies = [

[[package]]
name = "aws-smithy-types"
version = "1.2.8"
version = "1.2.9"
dependencies = [
 "base64-simd",
 "bytes",
@@ -1235,9 +1235,9 @@ dependencies = [

[[package]]
name = "libm"
version = "0.2.8"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"
checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa"

[[package]]
name = "linux-raw-sys"
@@ -1469,9 +1469,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"

[[package]]
name = "pin-project-lite"
version = "0.2.14"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"
checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff"

[[package]]
name = "pin-utils"
@@ -1680,9 +1680,9 @@ dependencies = [

[[package]]
name = "regex"
version = "1.11.0"
version = "1.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8"
checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
dependencies = [
 "aho-corasick",
 "memchr",
@@ -1780,9 +1780,9 @@ dependencies = [

[[package]]
name = "rustix"
version = "0.38.37"
version = "0.38.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811"
checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a"
dependencies = [
 "bitflags",
 "errno",
@@ -1937,22 +1937,22 @@ checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5"

[[package]]
name = "serde"
version = "1.0.213"
version = "1.0.214"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1"
checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5"
dependencies = [
 "serde_derive",
]

[[package]]
name = "serde_derive"
version = "1.0.213"
version = "1.0.214"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5"
checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766"
dependencies = [
 "proc-macro2",
 "quote",
 "syn 2.0.82",
 "syn 2.0.85",
]

[[package]]
@@ -2083,9 +2083,9 @@ dependencies = [

[[package]]
name = "syn"
version = "2.0.82"
version = "2.0.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021"
checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56"
dependencies = [
 "proc-macro2",
 "quote",
@@ -2122,7 +2122,7 @@ checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602"
dependencies = [
 "proc-macro2",
 "quote",
 "syn 2.0.82",
 "syn 2.0.85",
]

[[package]]
@@ -2216,7 +2216,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
dependencies = [
 "proc-macro2",
 "quote",
 "syn 2.0.82",
 "syn 2.0.85",
]

[[package]]
@@ -2267,7 +2267,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
 "proc-macro2",
 "quote",
 "syn 2.0.82",
 "syn 2.0.85",
]

[[package]]
@@ -2327,7 +2327,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568"
dependencies = [
 "quote",
 "syn 2.0.82",
 "syn 2.0.85",
]

[[package]]
@@ -2472,7 +2472,7 @@ dependencies = [
 "once_cell",
 "proc-macro2",
 "quote",
 "syn 2.0.82",
 "syn 2.0.85",
 "wasm-bindgen-shared",
]

@@ -2494,7 +2494,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68"
dependencies = [
 "proc-macro2",
 "quote",
 "syn 2.0.82",
 "syn 2.0.85",
 "wasm-bindgen-backend",
 "wasm-bindgen-shared",
]
@@ -2664,7 +2664,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
dependencies = [
 "proc-macro2",
 "quote",
 "syn 2.0.82",
 "syn 2.0.85",
]

[[package]]
+17 −17
Original line number Diff line number Diff line
@@ -283,7 +283,7 @@ dependencies = [

[[package]]
name = "aws-smithy-runtime-api"
version = "1.7.2"
version = "1.7.3"
dependencies = [
 "aws-smithy-async",
 "aws-smithy-types",
@@ -298,7 +298,7 @@ dependencies = [

[[package]]
name = "aws-smithy-types"
version = "1.2.8"
version = "1.2.9"
dependencies = [
 "base64-simd",
 "bytes",
@@ -1052,9 +1052,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"

[[package]]
name = "pin-project-lite"
version = "0.2.14"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"
checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff"

[[package]]
name = "pin-utils"
@@ -1131,9 +1131,9 @@ dependencies = [

[[package]]
name = "regex"
version = "1.11.0"
version = "1.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8"
checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
dependencies = [
 "aho-corasick",
 "memchr",
@@ -1329,22 +1329,22 @@ checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5"

[[package]]
name = "serde"
version = "1.0.213"
version = "1.0.214"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1"
checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5"
dependencies = [
 "serde_derive",
]

[[package]]
name = "serde_derive"
version = "1.0.213"
version = "1.0.214"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5"
checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766"
dependencies = [
 "proc-macro2",
 "quote",
 "syn 2.0.82",
 "syn 2.0.85",
]

[[package]]
@@ -1445,9 +1445,9 @@ dependencies = [

[[package]]
name = "syn"
version = "2.0.82"
version = "2.0.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021"
checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56"
dependencies = [
 "proc-macro2",
 "quote",
@@ -1471,7 +1471,7 @@ checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602"
dependencies = [
 "proc-macro2",
 "quote",
 "syn 2.0.82",
 "syn 2.0.85",
]

[[package]]
@@ -1555,7 +1555,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
dependencies = [
 "proc-macro2",
 "quote",
 "syn 2.0.82",
 "syn 2.0.85",
]

[[package]]
@@ -1606,7 +1606,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
 "proc-macro2",
 "quote",
 "syn 2.0.82",
 "syn 2.0.85",
]

[[package]]
@@ -1679,7 +1679,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568"
dependencies = [
 "quote",
 "syn 2.0.82",
 "syn 2.0.85",
]

[[package]]
+1 −1
Original line number Diff line number Diff line
[package]
name = "aws-config"
version = "1.5.9"
version = "1.5.10"
authors = [
    "AWS Rust SDK Team <aws-sdk-rust@amazon.com>",
    "Russell Cohen <rcoh@amazon.com>",
+1 −1
Original line number Diff line number Diff line
@@ -511,7 +511,7 @@ mod loader {
        pub fn test_credentials(self) -> Self {
            #[allow(unused_mut)]
            let mut ret = self.credentials_provider(Credentials::for_tests());
            #[cfg(all(feature = "sso", feature = "test-util"))]
            #[cfg(feature = "sso")]
            {
                use aws_smithy_runtime_api::client::identity::http::Token;
                ret = ret.token_provider(Token::for_tests());
Loading