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

Allow deny/forbid level lints in macros to cross crate boundaries #67720

Open
nvzqz opened this issue Dec 30, 2019 · 0 comments
Open

Allow deny/forbid level lints in macros to cross crate boundaries #67720

nvzqz opened this issue Dec 30, 2019 · 0 comments
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-feature-request Category: A feature request, i.e: not implemented / a PR. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@nvzqz
Copy link
Contributor

nvzqz commented Dec 30, 2019

I'm attempting to add an assert_ffi_safe! macro to static_assertions by creating an extern "C" block with a function that references the input types and marking it with #[forbid(improper_ctypes)] (see nvzqz/static-assertions#31). However, while the macro works correctly if used within the same crate, it results in false positives when used externally. This is evidenced by compile_fail doc tests passing.

I imagine that rustc lints are disabled when calling into a macro that is not defined within the calling crate so that they don't become a nuisance to consumers who have no control over the code within the macro. This is a case where ensuring that lints work across crate boundaries would be beneficial.

@jonas-schievink jonas-schievink added A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-feature-request Category: A feature request, i.e: not implemented / a PR. T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-feature-request Category: A feature request, i.e: not implemented / a PR. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants