Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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`](awslabs/cargo-check-external-types#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: ysaito1001 <[email protected]> Co-authored-by: Zelda Hessler <[email protected]>
- Loading branch information