-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
New lint: add function_abi_no_longer_unwind lint #689
Conversation
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.
The lint query looks good! There are a few issues in the metadata that need fixing, and I recommend taking a close look at other ABI-related lints and using them as inspiration here.
SemverQuery( | ||
id: "unwind_function_missing", | ||
human_readable_name: "unwind function missing", | ||
description: "pub fn changed from an unwind-capable ABI to the same-named ABI without unwind: \"C-unwind\" to \"C\"", |
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.
We don't necessarily know that the change was specifically C-unwind
to C
. It's possible that the change is from a different unwind-capable ABI to its non-unwind-capable equivalent.
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 see, I will change the description to "pub fn changed from an unwind-capable ABI to the same-named ABI without unwind" then. So that the description doesn't specify if the change was specifically C-unwind
to C
to anticipate new types of unwind capable ABI being added to rust in the future (although I don't know any other unwind capable FFI other than C-unwind
so far). Is this an appropriate approach to address this issue?
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.
Sounds good to me!
Here are a few more unwind-capable ABIs in case you're curious: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md#other-unwind-abi-strings
If we expand the set to not-yet-stable ABIs, the set is even bigger:
https://doc.rust-lang.org/beta/unstable-book/language-features/c-unwind.html
We might want to use the RFC that introduced unwind
ABIs as the reference link on line 6 btw: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md
human_readable_name: "unwind function missing", | ||
description: "pub fn changed from an unwind-capable ABI to the same-named ABI without unwind: \"C-unwind\" to \"C\"", | ||
required_update: Major, | ||
reference_link: None, |
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.
Please include an appropriate reference link here. Anything is better than nothing. For example, we could link to the reference page that other ABI-related lints use, if there's nothing more specific.
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.
Attached the proposal to add C-unwind
ABI. It contains lots of information about the design and behaviours. It also links to the RFC PR and issue to C-unwind
.
add trailing newline to unwind_function_missing.ron Co-authored-by: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com>
Co-authored-by: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com>
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.
Very nice! I added a brief bit of extra info to help users understand why this is a major breaking change, and will merge this promptly.
I'm planning to make a new release later today, and this lint will be part of it!
This PR is to implement the second task in #503