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 feeless_if in pallet section #6032

Merged
merged 4 commits into from
Oct 14, 2024
Merged

Conversation

eagr
Copy link
Contributor

@eagr eagr commented Oct 13, 2024

fixes #5981

Could confirm the issue with the added tests:

test tests/split_ui/pass/split_call.rs [should pass] ... error
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error[E0423]: expected value, found attribute macro `origin`
  --> tests/split_ui/pass/split_call.rs:23:1
   |
23 | #[frame_support::pallet(dev_mode)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a value
   |
   = note: this error originates in the attribute macro `frame_support::pallet` (in Nightly builds, run with -Z macro-backtrace for more info)

Description

origin unexpectedly resolved to a macro, which is available at the span of invocation. The solution here is to use the expansion as a function instead of a call and pass in the desired values to avoid ambiguities.

@eagr eagr requested a review from a team as a code owner October 13, 2024 12:03
@gui1117 gui1117 added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Oct 13, 2024
Copy link
Contributor

@gui1117 gui1117 left a comment

Choose a reason for hiding this comment

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

Looks good to me, but needs to fix clippy warning (so user using clippy are not bothered).

@bkchr bkchr added this pull request to the merge queue Oct 14, 2024
Merged via the queue into paritytech:master with commit 6f03f7a Oct 14, 2024
167 of 169 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

#[feeless_if(..)] breaks when used in a #[pallet_section]
3 participants