Description
Lints behave a little strange with macros, particularly from external crates. This should probably be captured somewhere, probably the diagnostics page for allow/warn/deny/forbid.
For example, lints generated on items created by an extern macro do not fire. Calling the following will not trigger a (deny by default) lint:
#[macro_export]
macro_rules! thing {
() => {
#[no_mangle]
pub const FOO: i32 = 5;
}
}
See also rust-lang/rust#58502 where the ident comes from the local crate, but does not pick up the global lint level of the extern crate.
So I imagine there are a variety of things to consider (the location of a span, the lint level of the local and extern crates, etc.). I don't know where to begin distilling how things work. Perhaps it is not as complex as it appears. I also get the impression that it depends on exactly which lint it is, since some are done at different phases.