-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Possible false-negative for changed mutability in trait #1141
Comments
Neat idea, thanks @jaybosamiya-ms! Technically this is part of #149, but in practice it's enough of a special case that I think we should be able to tackle it separately, without needing to complete #149 first. Is this relevant to a Microsoft project by any chance? Asking because I noticed this issue was opened via your work account. |
Thanks for the quick response @obi1kenobi! I did come across the issue at work, but not on any Microsoft product/service (the work/personal account split is more of an access-separation thing, more than anything else) Context, if curious: I build research prototypes. On one such (currently private) codebase, I recently experimentally added cargo-semver-checks as a GitHub action. Interestingly, not to remind us to bump semver, since this is very early-stage prototype code (not even "v0.0.1" ready 🙃), but as a comment-only bot---roughly speaking, to possibly induce extra thought about decisions while we are figuring out the right abstractions for the actual research project itself. It has worked great to point some changes out (especially noticing dyn-compatibility changes has been helpful!). However, when I recently introduced a change to one of our traits where I would've expected the bot to say "this changed", it didn't, thus me opening the issue. Not a blocker; I mostly opened the issue for easier search just in case anyone else hits the same, since my first few searches didn't locate related issues (and I noticed #149 only while actually making the new issue). Again, please feel free to close this in preference for the more general #149 if it helps reduce your work. |
Thanks, useful context! And this issue is useful because we should be able to tackle it before #149 as a whole, so I'll keep it. In the meantime, I'd appreciate any help in getting Microsoft to fund cargo-semver-checks! It's used in a number of public Microsoft repositories (and I'd imagine in some non-public ones too), and it'd be lovely to have an official communication channel + a relationship of mutual support. |
While I'm not familiar with the processes regarding funding and/or official comms channels (I'm relatively new here) I will keep a look out if I find anything. A quick (internal) search seems to suggest product/service teams may have a clearer process, but I couldn't immediately find specifics, unfortunately. Will keep an eye out though. |
Thank you, I appreciate it! |
Is this about an existing lint, or proposing a new one?
trait-item-signature
Known issues that might be causing this
Steps to reproduce the bug with the above code
Old code:
Updated code (note how the mutability switched for both):
Run
cargo semver-checks --baseline-rev {oldrev}
Actual Behaviour
Notice it says
Summary no semver update required
even though it should report a breakage.Expected Behaviour
Both the change from
&self
->&mut self
, and&mut self
->&self
are breaking changes (downstream crates thatimpl
the trait, or might be depending on the trait need to update their code). Thus it should be reported as breaking.Generated System Information
Software version
cargo-semver-checks 0.37.0 (68711cc)
Operating system
Linux 5.15.167.4-microsoft-standard-WSL2
Command-line
cargo version
Compile time information
Build Configuration
No response
Additional Context
I believe this is yet another instance of not yet catching type changes sufficiently. Nonetheless, I thought it might be helpful to report this as a separate issue since I didn't notice any issues specifically talking about the types in trait function signatures, and
trait-item-signature
seems to indicate that any such change should be reported. Sorry for the noise if you think this is already covered as part of #149.The text was updated successfully, but these errors were encountered: