Closed
Description
One can use macro expansion to bypass all early attribute checks, directly:
macro_rules! evil {
() => {
#[derive_Debug]
struct Foo;
}
}
evil!();
fn main() {}
Or by using the built-in include!
macro.
// foo.rs
#[derive_Debug]
struct Foo;
include!("foo.rs");
fn main() {}
Found while investigating libpnet
breakage.
This affects any use of #[derive(...)]
in syntex
, as virtually everyone uses include!
.
Even though I don't like stabilizing this, there may be too many cases in the wild.