Allow deny/forbid level lints in macros to cross crate boundaries #67720
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.
I'm attempting to add an
assert_ffi_safe!
macro tostatic_assertions
by creating anextern "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 bycompile_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.The text was updated successfully, but these errors were encountered: