-
Notifications
You must be signed in to change notification settings - Fork 189
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
Derive Eq
and Hash
wherever possible
#2223
Merged
Merged
Commits on Jan 17, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 885eb9d - Browse repository at this point
Copy the full SHA 885eb9dView commit details
Commits on Jan 18, 2023
-
Configuration menu - View commit details
-
Copy full SHA for cb1cd73 - Browse repository at this point
Copy the full SHA cb1cd73View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a0f67c - Browse repository at this point
Copy the full SHA 2a0f67cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7fb08a6 - Browse repository at this point
Copy the full SHA 7fb08a6View commit details -
Configuration menu - View commit details
-
Copy full SHA for e478aef - Browse repository at this point
Copy the full SHA e478aefView commit details -
Configuration menu - View commit details
-
Copy full SHA for 40aa12f - Browse repository at this point
Copy the full SHA 40aa12fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e754681 - Browse repository at this point
Copy the full SHA e754681View commit details -
Derive
Eq
andHash
wherever possibleIn server SDKs, these traits can be implemented by any shape _except_ if the shape's closure contains: 1. A `float`, `double`, or `document` shape: floating point types in Rust do not implement `Eq`. Similarly, [`document` shapes] may contain arbitrary JSON-like data containing floating point values. 2. A [@streaming] shape: all the streaming data would need to be buffered first to compare it. Additionally, the `Hash` trait cannot be implemented by shapes whose closure contains: 1. A `map` shape: we render `map` shapes as `std::collections::HashMap`, which _do not_ implement `Hash`. See smithy-lang/smithy#1567. In **client SDKs, these traits cannot be derived on any code-generated Rust types corresponding to Smithy shapes**, since e.g. adding new optional members to a structure [is a backwards-compatible change], and doing so alters the semantics of these traits. However, this commit does implement these traits for the `aws_smithy_types::date_time::DateTime` and `aws_smithy_types::Blob` runtime types. This change is necessary to efficiently implement the `@uniqueItems` constraint trait in server SDKs. [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html [`document` shapes]: https://smithy.io/2.0/spec/simple-types.html#document [@streaming]: https://smithy.io/2.0/spec/streaming.html [is a backwards-compatible change]: https://smithy.io/2.0/guides/evolving-models.html#updating-structures
Configuration menu - View commit details
-
Copy full SHA for 373a1ec - Browse repository at this point
Copy the full SHA 373a1ecView commit details -
Configuration menu - View commit details
-
Copy full SHA for f1f5f8f - Browse repository at this point
Copy the full SHA f1f5f8fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8e24132 - Browse repository at this point
Copy the full SHA 8e24132View commit details -
Configuration menu - View commit details
-
Copy full SHA for fa929a6 - Browse repository at this point
Copy the full SHA fa929a6View commit details -
Derive
Eq
andHash
wherever possibleIn server SDKs, these traits can be implemented by any shape _except_ if the shape's closure contains: 1. A `float`, `double`, or `document` shape: floating point types in Rust do not implement `Eq`. Similarly, [`document` shapes] may contain arbitrary JSON-like data containing floating point values. 2. A [@streaming] shape: all the streaming data would need to be buffered first to compare it. Additionally, the `Hash` trait cannot be implemented by shapes whose closure contains: 1. A `map` shape: we render `map` shapes as `std::collections::HashMap`, which _do not_ implement `Hash`. See smithy-lang/smithy#1567. In **client SDKs, these traits cannot be derived on any code-generated Rust types corresponding to Smithy shapes**, since e.g. adding new optional members to a structure [is a backwards-compatible change], and doing so alters the semantics of these traits. However, this commit does implement these traits for the `aws_smithy_types::date_time::DateTime` and `aws_smithy_types::Blob` runtime types. This change is necessary to efficiently implement the `@uniqueItems` constraint trait in server SDKs. This commit also introduces a constrained shape symbol metadata provider (`ConstrainedShapeSymbolMetadataProvider.kt`), to centralize generation of Rust metadata (derives, visibility) in one place, instead of each constrained type generator having to manually adjust metadata. Some constrained type methods are now conditionally generated based on visibility, instead of relying on `#[allow(dead_code)]`. [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html [`document` shapes]: https://smithy.io/2.0/spec/simple-types.html#document [@streaming]: https://smithy.io/2.0/spec/streaming.html [is a backwards-compatible change]: https://smithy.io/2.0/guides/evolving-models.html#updating-structures
Configuration menu - View commit details
-
Copy full SHA for d926b14 - Browse repository at this point
Copy the full SHA d926b14View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd6c32e - Browse repository at this point
Copy the full SHA dd6c32eView commit details -
Configuration menu - View commit details
-
Copy full SHA for f1f0b3d - Browse repository at this point
Copy the full SHA f1f0b3dView commit details -
Configuration menu - View commit details
-
Copy full SHA for ad47354 - Browse repository at this point
Copy the full SHA ad47354View commit details
Commits on Jan 19, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 8078964 - Browse repository at this point
Copy the full SHA 8078964View commit details -
Configuration menu - View commit details
-
Copy full SHA for d677059 - Browse repository at this point
Copy the full SHA d677059View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.