danielpclark / rutie

“The Tie Between Ruby and Rust.”
MIT License
939 stars 62 forks source link

allow(unused_mut) and allow(unused_variables) on methods! rtself arg #156

Closed danlarkin closed 7 months ago

danlarkin commented 2 years ago

This change will stop the warnings generated by methods! macroexpansion when rtself isn't used in some functions, even though it is in others.

Also it bounds the warning suppression to the $rtself_name parameter instead of the entire function body.

danielpclark commented 2 years ago

@danlarkin quick question... this wouldn't cause any breaking changes by removing the outer allow?

danlarkin commented 2 years ago

Do compiler warnings count as breaking changes?

Previously, all functions inside methods!/unsafe_methods! were adorned with #[allow(unused_mut)] which meant that any unused mut didn't cause a warning from rustc. Now only an unused rtself will be exempt from that warning.

So an upgrade could cause a warning where there was previously not one, but I would argue this new behavior is strictly more correct.

danielpclark commented 2 years ago

Do compiler warnings count as breaking changes?

Generally no. But some may make part of the deployment process have a strict no warning allowed configuration. So I'll think about having this be a minor version bump rather than a patch version bump as per the versioning outlined in the README.

danlarkin commented 1 year ago

low pressure reminder that this can still be merged :)

danielpclark commented 7 months ago

This has been merged.