Lint: Check that every crate contains at most one export_lint_pass!
call
#207
Labels
A-marker-lints
Area: Lints for the marker API (marker_lints crate)
C-enhancement
Category: New feature or request
E-good-first-issue
Participation: Good for newcomers
The
export_lint_pass
macro is required to load a lint crate by marker. The macro generates some functions which are marked as#[no_mangle]
. If the macro would be called multiple times per crate, it would generate multiple functions with the name. This is unsound (I actually don't know what exactly happens).A lint should check that each crate contains at most one call to
export_lint_pass
. It would be cool if we could check that each lint crate defines it exactly once, but I believe that we currently don't have a mechanism to determine if the compiled crate is a lint crate or just a library. Checking at most once, will be sufficient for now :)Marker currently has no way to determine, which macro was written in the code. The lint should instead check that each crate contains at most one function called
marker_api_version
and one calledmarker_lint_crate_bindings
The text was updated successfully, but these errors were encountered: