Allow attributes in macro invocations #22
Conversation
Allows `#[cfg]` to be used to make certain definitions conditional. Such as for library version feature flags.
There is still a "local ambiguity when calling macro `external_library`" error. That appears to be a real bug.
Currently fails at macro expansion due to existing issue.
|
Added some testing improvements. I see some issues trying to test I don't think those block this from being merged and released. Though a semver breaking version of the crate will probably be needed at some point to fix those. |
| readme = "README.md" | ||
| keywords = ["dylib", "dlopen"] | ||
| categories = ["api-bindings"] | ||
| edition = "2021" |
There was a problem hiding this comment.
Is this specifically needed for this change?
There was a problem hiding this comment.
It shouldn't be necessary, no. It just seems a bit unusual at this point for a crate to be using the default edition.
I don't think there's any need to support Rust versions too old for the 2021 edition at this point.
There was a problem hiding this comment.
In that case, could you also update the CI accordingly? It's currently failing because of that change.
There was a problem hiding this comment.
I've updated CI to the first version of Rust that supports the 2021 edition.
|
Just to confirm, have you tested that this changes actually makes it possible to add a feature flag to Smithay/wayland-rs#735 ? |
|
Yes. Simply adding |
Allows
#[cfg]to be used to make certain definitions conditional. Such as for library version feature flags.Needed for Smithay/wayland-rs#735 so it can have a feature flag for the libwayland version.
Seems to work, but still needs to be added to
dlib-test, with CI to test with and without the feature.