awslabs / aws-sdk-rust

AWS SDK for the Rust Programming Language
https://awslabs.github.io/aws-sdk-rust/
Apache License 2.0
2.98k stars 246 forks source link

BehaviorVersion's interface is not as future-proof as the doc says #1111

Closed Ten0 closed 5 months ago

Ten0 commented 6 months ago

Describe the bug

It is possible to construct a BehaviorVersion:

image

Using the following syntax:

let behavior: BehaviorVersion = BehaviorVersion {};

While the documentation says that latest may change behavior but v2023_11_09 would keep its behavior, that is impossible because one cannot add new fields to BehaviorVersion without that being a breaking change due to the currently allowed explicit construction.

Expected Behavior

let behavior: BehaviorVersion = BehaviorVersion {};

should not compile, one should be forced to use either latest or v2023_11_09 to instantiate a BehaviorVersion.

Current Behavior

compiles

Possible Solution

That should be achieved by defining the struct as so:

pub struct BehaviorVersion {
    _private: (),
}

Additional Information/Context

This is technically a breaking change but since this was released recently and it's documented that this API shouldn't be used, better now than later.

Version

AWS SDK 1.1.8
aajtodd commented 5 months ago

This was merged and released. Closing.

github-actions[bot] commented 5 months ago

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.