Skip to content
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

Fix for Rust compiler warning about derive helpers #2581

Merged
merged 2 commits into from
Apr 19, 2023

Conversation

mcmasn-amzn
Copy link
Contributor

Motivation and Context

Follow-up to #2434

Description

This provides a way to fix a compiler warning. Attributes created using RustMetadata.additionalAttributes may trigger compiler warnings (rust-lang/rust#79202) such as

warning: derive helper attribute is used before it is introduced
    --> src/model.rs:7674:3
     |
7674 | #[serde(tag = "_type", content = "_content")]
     |   ^^^^^
7675 | #[derive(
7676 |     serde::Deserialize,
     |     ------------------ the attribute is introduced here
     |
     = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
     = note: for more information, see issue #79202 <https://github.com/rust-lang/rust/issues/79202>

Testing

Added a unit test to validate the sort order is applied correctly to Attributes with isDeriveHelper = true.

@mcmasn-amzn mcmasn-amzn requested review from a team as code owners April 14, 2023 15:41
Copy link
Contributor

@david-perez david-perez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@david-perez david-perez added the needs-client-review Generic client label Apr 17, 2023
@mcmasn-amzn
Copy link
Contributor Author

Suggestions applied, thanks @david-perez

@ysaito1001 ysaito1001 removed the needs-client-review Generic client label Apr 19, 2023
@Velfi Velfi added this pull request to the merge queue Apr 19, 2023
Merged via the queue into smithy-lang:main with commit d626fd2 Apr 19, 2023
unexge pushed a commit that referenced this pull request Apr 24, 2023
## Motivation and Context
Follow-up to #2434


## Description
This provides a way to fix a compiler warning. Attributes created using
RustMetadata.additionalAttributes may trigger compiler warnings
(rust-lang/rust#79202) such as

```
warning: derive helper attribute is used before it is introduced
    --> src/model.rs:7674:3
     |
7674 | #[serde(tag = "_type", content = "_content")]
     |   ^^^^^
7675 | #[derive(
7676 |     serde::Deserialize,
     |     ------------------ the attribute is introduced here
     |
     = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
     = note: for more information, see issue #79202 <rust-lang/rust#79202>

```

## Testing
Added a unit test to validate the sort order is applied correctly to
Attributes with isDeriveHelper = true.

---------

Co-authored-by: david-perez <[email protected]>
rcoh pushed a commit that referenced this pull request Apr 24, 2023
## Motivation and Context
Follow-up to #2434


## Description
This provides a way to fix a compiler warning. Attributes created using
RustMetadata.additionalAttributes may trigger compiler warnings
(rust-lang/rust#79202) such as

```
warning: derive helper attribute is used before it is introduced
    --> src/model.rs:7674:3
     |
7674 | #[serde(tag = "_type", content = "_content")]
     |   ^^^^^
7675 | #[derive(
7676 |     serde::Deserialize,
     |     ------------------ the attribute is introduced here
     |
     = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
     = note: for more information, see issue #79202 <rust-lang/rust#79202>

```

## Testing
Added a unit test to validate the sort order is applied correctly to
Attributes with isDeriveHelper = true.

---------

Co-authored-by: david-perez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants