-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Forward attributes on impl
function parameters to variable declaration.
#227
Forward attributes on impl
function parameters to variable declaration.
#227
Conversation
quote!( | ||
#(#attrs)* | ||
let #mutability #ident = #ident; | ||
) | ||
} | ||
} else { | ||
let pat = &arg.pat; |
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.
I'm not sure how to hit this branch -- I tried using a DeconstructedStruct { value }
but it didn't parse.
Presumably the same attribute forwarding needs to be done here as well
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.
Try #[cfg(any())] _: T
or #[cfg(any())] (a, b): (T, T)
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.
cool thanks, managed to simplify the test case
40af21a
to
3cb7599
Compare
3cb7599
to
6cf682f
Compare
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.
Thanks!
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [async-trait](https://github.com/dtolnay/async-trait) | dependencies | patch | `0.1.60` -> `0.1.61` | --- ### Release Notes <details> <summary>dtolnay/async-trait</summary> ### [`v0.1.61`](https://github.com/dtolnay/async-trait/releases/tag/0.1.61) [Compare Source](dtolnay/async-trait@0.1.60...0.1.61) - Fix async function signatures that involve #\[cfg(...)] attributes on parameters ([#​227](dtolnay/async-trait#227), thanks [@​azriel91](https://github.com/azriel91)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC44NC4xIiwidXBkYXRlZEluVmVyIjoiMzQuOTMuMCJ9--> Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Co-authored-by: crapStone <crapstone01@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1707 Reviewed-by: crapStone <crapstone@noreply.codeberg.org> Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org> Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Fixes #226.
It feels rare to have attributes on parameters, I can't imagine a concrete scenario where forwarding all attributes is undesirable.
We could filter the attributes that are forwarded to only the
#[cfg(..)]
ones.