Skip to content
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

[unsafe-fields] adding enum rule into unsafe-fields macro #2034

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dacozai
Copy link
Contributor

@dacozai dacozai commented Nov 8, 2024

#1957: support enum in [unsafe-fields]

@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.46%. Comparing base (13c11f8) to head (bc99e92).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2034   +/-   ##
=======================================
  Coverage   89.46%   89.46%           
=======================================
  Files          16       16           
  Lines        5838     5838           
=======================================
  Hits         5223     5223           
  Misses        615      615           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dacozai
Copy link
Contributor Author

dacozai commented Nov 8, 2024

I am sorry that I should clarify this in the first place.
I am not sure that the below are goals as well

unsafe_fields {
    enum FooEnum {
        #[unsafe]
        A,
        B,
        #[unsafe]
        C(i32, String),
    }
}
  1. I am not sure unit variant is possible to do so. Maybe the input name will be A and the input type will be FooEnum::A.
  2. I am still surveying the tuple variant. Although I don't know if it can be achieved or not, it seems achievable to me.

Thank you 🙏🏻

@jswrenn
Copy link
Collaborator

jswrenn commented Nov 8, 2024

  1. Don't worry about unit variants — this crate is about supporting unsafe fields, not unsafe variants!
  2. Sounds good. We definitely want support for tuple-like structs and fields.

@dacozai
Copy link
Contributor Author

dacozai commented Nov 13, 2024

Hi @jswrenn,
After few days of surveying, I still failed to achieve 😭
I posted a question in the forum to check if I missed anything. If there is any direction that you can guide, please let me know.
Appreciate your help. Many thanks.

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