Skip to content

lint: Improve ffi-unsafe enum lint warning #15893

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

Closed

Conversation

catharsis
Copy link
Contributor

I think this is an improvement of the previous warning message, which

  • like the comment that I removed implies - is in need of some
    improvement.
    I've opted to point the user in the right direction w.r.t how to fix the
    problem, which I think is good form.

Not being familiar with the repr(...) attribute, I personally had to
check the lint rules myself to figure out what was wrong. Hopefully,
this will save he next person some time and headache.

Signed-off-by: Anton Lofgren [email protected]

I think this is an improvement of the previous warning message, which
- like the comment that I removed implies - is in need of some
improvement.
I've opted to point the user in the right direction w.r.t how to fix the
problem, which I think is good form.

Not being familiar with the repr(...) attribute, I personally had to
check the lint rules myself to figure out what was wrong. Hopefully,
this will save he next person some time and headache.

Signed-off-by: Anton Lofgren <[email protected]>
// hmm... this message could be more helpful
"found enum type without foreign-function-safe
representation annotation in foreign module, consider \
adding a #[repr(...)] attribute to the enumeration");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course, the message is only a suggestion - if someone's got something even better I'll happily change it. As long as the resulting message actually tells me what I could do to fix it, I'll be happy :-)

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 16, 2023
…ykril

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

Successfully merging this pull request may close these issues.

3 participants