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

Write a lint that ensures that no_jsmanaged_fields is used correctly #5386

Open
jdm opened this issue Mar 26, 2015 · 2 comments
Open

Write a lint that ensures that no_jsmanaged_fields is used correctly #5386

jdm opened this issue Mar 26, 2015 · 2 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Mar 26, 2015

We should be able to check all of the fields of the target of the no_jsmanaged_fields macro and ensure that none of them are marked jsmanaged. This will prevent misuse of the macro.

@leavengood
Copy link
Contributor

@leavengood leavengood commented Mar 26, 2015

To add some more detail, it seems one would want to look for the jstraceable attribute, as defined in https://github.com/servo/servo/blob/master/components/plugins/jstraceable.rs

An existing lint which checks for attributes is https://github.com/servo/servo/blob/master/components/plugins/lints/privatize.rs

This new lint would need to find calls to the no_jsmanaged_fields macro, and then look at the fields of any structs passed to it to see if the jstraceable attribute is defined on any of the fields.

I think (Servo newbie)

@jdm
Copy link
Member Author

@jdm jdm commented Mar 26, 2015

Whoops, I meant must_root when I said "none of them are marked jsmanaged". jstraceable isn't strong enough for our purposes here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.