-
Notifications
You must be signed in to change notification settings - Fork 35
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
Ignore unrelated field attributes #36
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just curious about the Cargo.toml change
Cargo.toml
Outdated
|
||
[workspace] | ||
members = ["testcrate"] | ||
syn = "0.13" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this change necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the workspace is set up I see the following:
derive-new\testcrate> cargo test
Compiling libc v0.2.39
Compiling kernel32-sys v0.2.2
Compiling derive-new v0.5.3
Compiling serde_derive v1.0.37
Compiling term v0.4.6
error[E0599]: no method named `make_where_clause` found for type `syn::Generics` in the current scope
--> github.com-1ecc6299db9ec823\serde_derive-1.0.37\src\bound.rs:47:14
|
47 | generics.make_where_clause()
| ^^^^^^^^^^^^^^^^^
I looked into it a bit but didn't root cause it. Might not occur on a *nix box if the build failed in term
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an error in serde_derive, and it would be weird to see that only on some platforms. I'm on Mac OS and build without error. Maybe it is due to how you are running the tests? I run cargo test --all
from the root directory, rather than anything in testcrate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that seems unlikely. I see the same errors when I execute tests that way.
Edit: happens with both stable and nightly msvc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @dtolnay any idea what might be going on with this Serde build error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea but it seems like the sort of thing that cargo update
(or not having a lockfile checked in) would fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you're right, added it back.
Well that is amusing. |
Thanks! |
Published 0.5.4 |
Currently all attributes on fields are parsed by derive-new. This change updates the attribute parsing logic to ignore any attribute that aren't specifically for derive-new. For example, previously:
Would result in the following error:
The revision of compiletest was updated to allow all tests to build on stable. It might be a good idea to configure the CI to use the minimum supported version of Rust to execute tests.
Additionally, I was having issues building tests due to the workspace configuration and syn::Generics. I didn't look into it much, but removed the workspace configuration so it wouldn't affect others.