-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow lints to declare that they're pure #59024
Comments
Can that be made more first-class so that there doesn't have to be a single builtin lint pass that's known to work on a module? Also avoid running ones which are disabled until they get enabled. |
Oh, that can be used at the per pass level. Hmm Still feel like this should be an optional method on the LintPass trait itself |
The single builtin lint pass is there for performance reasons to avoid the virtual dispatch for lints and it also allows LLVM to do inter-lint optimizations. |
Ah hmmm |
Has there been any activity on this? it came up as something wanted so that Sending this since it seems the original conversation has died out with no concrete resolution 5 years ago |
@blyxyas has been working on not running unnecessary lints. though i also question whether the lint would actually have such bad perf effects and it seems like it's at least worth a try if you care. |
Clippy and rustc both have a bunch of allow by default lints. Due to the way lint passes work, these have to be run even if never enabled, since lint passes may store state between
check_foo
calls.Most lints don't do this, most lints are zero-sized.
It would be nice to allow LintPasses to declare that they are "pure", and have rustc omit allowed pure passes from the list of lint passes until enabled. This has some performance benefits but would also allow for incremental linting if we ever want that.
cc @Zoxc @oli-obk
The text was updated successfully, but these errors were encountered: