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

Remove the clippy attribute hack in macros #56

Open
yannbolliger opened this issue Jan 5, 2021 · 1 comment
Open

Remove the clippy attribute hack in macros #56

yannbolliger opened this issue Jan 5, 2021 · 1 comment
Labels
enhancement Improvement to an existing feature

Comments

@yannbolliger
Copy link
Collaborator

yannbolliger commented Jan 5, 2021

@romac said:

One can register custom attributes on Rust nightly with #![feature(register_tool)]: rust-lang/rust#66070 (would help get rid of the clippy:: hack:

/// Note that we simply want to attach some attributes to the item in question. Currently,
/// Rust doesn't permit user-defined attributes that stay around until the later phases of
/// rustc. However, any attribute in the `clippy::` group is accepted, and clippy itself
/// doesn't seem to complain about unknown attributes. We therefore abuse this to attach
/// some attributes of our own for the stainless extraction pass to detect.

@yannbolliger
Copy link
Collaborator Author

Unfortunately, this doesn't currently work because the feature has to be turned on in the crate. Hence, it is not enough to have

#![feature(register_tool)]
#![register_tool(stainless_lib)]

in the libstainless but it would need to sit in the actual file to verify, which we don't want.

@romac romac added the enhancement Improvement to an existing feature label Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants