Skip to content

fix: Fix cache problems with lints level #19824

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChayimFriedman2
Copy link
Contributor

@ChayimFriedman2 ChayimFriedman2 commented May 19, 2025

Fixes #19823.

I knew this cache will cause us problems.

I question the need for a cache (yep, I authored this code, I know). When there is no cache there are no cache problems. And we all know what the hardest problems in computer science are. This code was just needlessly complex.

Ideally I believe we would have lint levels defined as db queries and query them before firing the lints. Unfortunately in rustc lint levels are tied with spans, which can be arbitrary pieces of code, and we can't implement something like that for our hir. So we're stuck with AST-based lint resolution (which isn't that bad, actually).

By removing the cache.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 19, 2025
Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given diagnostics should be rare (aside from syntax errors), in that the are only a handful usually, the cache is likely not going to be that impactful either way.

@ChayimFriedman2
Copy link
Contributor Author

My original thought was that some files, e.g. binding files, have some lints (case lints) triggered on large amounts. That is correct, but now I don't think it justifies the code complexity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

#[allow(unsafe_op_in_unsafe_fn)] sometimes ignored when the impl body is generated by a macro
3 participants