Skip to content

[Move] #[allow(unused_mut_ref)] does not work properly with lambda functions #22267

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

Open
admin-aftermath opened this issue May 29, 2025 · 2 comments
Assignees
Labels

Comments

@admin-aftermath
Copy link

If you mark an argument of a macro lambda function as mutable, but never use it mutably, you will receive the following warning:

Mutable reference is never used mutably, consider switching to an immutable reference '&' instead. This warning can be suppressed with '#[allow(unused_mut_ref)]' applied to the 'module' or module member ('const', 'fun', or 'struct').

When the latter option is done, it doesn't not suppress the warning. For example,
Image

Copy link
Contributor

Thank you for opening this issue, a team member will review it shortly. Until then, please do not interact with any users that claim to be from Sui support and do not click on any links!

@cgswords
Copy link
Contributor

cgswords commented May 31, 2025

Hi, thank you for the bug report. Can you please provide a sample call / value for $f? My minimal example does not reproduce this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants