Closed
Description
Just as we now support pluggable macros, I would love to see pluggable lints (with associated pluggable attributes). I'm thinking these lints/attributes could be scoped by the crate name, so something like
#[attribute_registrar]
pub fn attribute_registrar(registrar: |Name, Type|) {
// register attribute names with whatever info is used
// to determine if and how arguments are specified
register(token::intern("myattr"), ...);
}
#[lint_registrar]
pub fn lint_registrar(register: |Name, LintExtension|) {
register(token::intern("mylint"), ...);
}
when loaded as
#[feature(phase)];
#[phase(syntax)]
extern mod foo;
would add the attribute #[foo::myattr]
and the lint foo::mylint
.
The motivating reason here for me is that I believe for my rust-lua project to be safe I need to have a lint to ensure that the functions exposed to Lua do not make any Lua calls when there is a value with a destructor on the stack. To that end I want to annotate my Lua methods with #[lua::longjmp]
and have a lint that disallows calling any #[lua::longjmp]
method with destructors on the stack.
Metadata
Metadata
Assignees
Labels
No labels