-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
I-needs-decisionIssue: In need of a decision.Issue: In need of a decision.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
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.
Metadata
Metadata
Assignees
Labels
I-needs-decisionIssue: In need of a decision.Issue: In need of a decision.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team