rust-analyzer/crates/hir-def/src
bors fd243cd0fb Auto merge of #18099 - ChayimFriedman2:diag-only-necessary, r=Veykril
Use more correct handling of lint attributes

The previous analysis was top-down, and worked on a single file (expanding macros). The new analysis is bottom-up, starting from the diagnostics and climbing up the syntax and module tree.

While this is more efficient (and in fact, efficiency was the motivating reason to work on this), unfortunately the code was already fast enough. But luckily, it also fixes a correctness problem: outline parent modules' attributes were not respected for the previous analysis. Case lints specifically did their own analysis to accommodate that, but it was limited to only them. The new analysis works on all kinds of lints, present and future.

It was basically impossible to fix the old analysis without rewriting it because navigating the module hierarchy must come bottom-up, and if we already have a bottom-up analysis (including syntax analysis because modules can be nested in other syntax elements, including macros), it makes sense to use only this kind of analysis.

Few other bugs (not fundamental to the previous analysis) are also fixed, e.g. overwriting of lint levels (i.e. `#[allow(lint)] mod foo { #[warn(lint)] mod bar; }`.

After this PR is merged I intend to work on an editor command that does workspace-wide diagnostics analysis (that is, `rust-analyzer diagnostics` but from your editor and without having to spawn a new process, which will have to analyze the workspace from scratch). This can be useful to users who do not want to enable check on save because of its overhead, but want to see workspace wide diagnostics from r-a (or to maintainers of rust-analyzer).

Closes #18086.
Closes #18081.
Fixes #18056.
2024-09-12 12:39:27 +00:00
..
body Auto merge of #18106 - Veykril:push-yzsqoykyowts, r=Veykril 2024-09-12 06:21:01 +00:00
data feat: Implement cast typechecks 2024-09-03 04:11:36 +09:00
dyn_map Try caching macro calls more aggressively 2024-06-04 15:23:00 +02:00
hir Properly account for editions in names 2024-08-16 16:46:24 +03:00
item_tree Properly account for editions in names 2024-08-16 16:46:24 +03:00
macro_expansion_tests Properly set the working directory for proc-macro execution 2024-09-11 12:23:12 +02:00
nameres Fix name resolution of shadowed builtin macro 2024-08-28 23:20:46 +03:00
path fix: Insert a generic arg for impl Trait when lowering generic args 2024-08-05 00:06:29 +09:00
attr.rs Lift out workspace related data into a separate query to preserve crategraph deduplication 2024-09-11 12:16:41 +02:00
body.rs Auto merge of #18075 - roife:fix-issue-17858, r=Veykril 2024-09-11 12:05:57 +00:00
builtin_type.rs Switch token trees to use Symbols 2024-07-16 10:11:59 +02:00
child_by_source.rs Make GenericParams::lifetimes private 2024-07-02 13:45:53 +02:00
data.rs Revert "feat: Implement module_path macro" 2024-08-27 08:19:09 +02:00
db.rs Auto merge of #17863 - Veykril:include-diags, r=Veykril 2024-08-12 11:48:32 +00:00
dyn_map.rs Merge commit '3b7c7f97e4' into sync-from-ra 2023-11-08 08:15:03 +02:00
expander.rs Revert "feat: Implement module_path macro" 2024-08-27 08:19:09 +02:00
find_path.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
generics.rs Replace once_cell with std's recently stabilized OnceCell/Lock and LazyCell/Lock 2024-08-16 09:53:37 +03:00
hir.rs Fix name fetching being incorrect for asm operands 2024-09-05 13:41:03 +02:00
import_map.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
item_scope.rs Auto merge of #17905 - ChayimFriedman2:edition-dependent-raw-keyword, r=Veykril 2024-08-16 13:49:32 +00:00
item_tree.rs Auto merge of #17905 - ChayimFriedman2:edition-dependent-raw-keyword, r=Veykril 2024-08-16 13:49:32 +00:00
lang_item.rs Add helper methods to retrieve Future::Output and Iterator::Item 2024-08-24 23:46:32 +03:00
lib.rs Revert "feat: Implement module_path macro" 2024-08-27 08:19:09 +02:00
lower.rs Disallow nested impl traits 2024-07-04 23:31:55 +09:00
nameres.rs Use more correct handling of lint attributes 2024-09-12 15:24:38 +03:00
path.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
per_ns.rs chore: Prefer tracing span shorthand macros 2024-06-06 16:52:25 -07:00
pretty.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
resolver.rs Fix stable iteration ordering for Map<Name, ...> usages 2024-07-15 11:25:46 +02:00
src.rs Remove unused trace module 2024-07-25 14:08:48 +02:00
test_db.rs Simplify FileDelegate 2024-08-05 13:03:03 +02:00
visibility.rs Intern ModPath within RawVisibility 2024-06-24 10:07:32 +02:00