Skip to content

Commit 80f6dd6

Browse files
aws-sdk-rust-ciysaito1001Zelda Hessler
authored
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]>
1 parent f648759 commit 80f6dd6

File tree

19 files changed

+333
-339
lines changed

19 files changed

+333
-339
lines changed

.github/workflows/pull-request-bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ env:
3030
apt_dependencies: libssl-dev gnuplot jq
3131
java_version: 17
3232
rust_toolchain_components: clippy,rustfmt
33-
rust_nightly_version: nightly-2024-03-15
33+
rust_nightly_version: nightly-2024-06-30
3434

3535
jobs:
3636
generate-diff:

aws/rust-runtime/Cargo.lock

Lines changed: 27 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aws/rust-runtime/aws-config/Cargo.lock

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aws/rust-runtime/aws-config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aws-config"
3-
version = "1.5.9"
3+
version = "1.5.10"
44
authors = [
55
"AWS Rust SDK Team <[email protected]>",
66
"Russell Cohen <[email protected]>",

aws/rust-runtime/aws-config/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ mod loader {
511511
pub fn test_credentials(self) -> Self {
512512
#[allow(unused_mut)]
513513
let mut ret = self.credentials_provider(Credentials::for_tests());
514-
#[cfg(all(feature = "sso", feature = "test-util"))]
514+
#[cfg(feature = "sso")]
515515
{
516516
use aws_smithy_runtime_api::client::identity::http::Token;
517517
ret = ret.token_provider(Token::for_tests());

aws/rust-runtime/aws-inlineable/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ publish = false
1212
repository = "https://github.com/smithy-lang/smithy-rs"
1313

1414
[features]
15-
http_1x = ["dep:http-1x", "dep:http-body-1x", "aws-smithy-runtime-api/http-1x"]
15+
http-1x = ["dep:http-1x", "dep:http-body-1x", "aws-smithy-runtime-api/http-1x"]
1616

1717
[dependencies]
1818
aws-credential-types = { path = "../aws-credential-types" }

0 commit comments

Comments
 (0)