aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres
Commit message (Collapse)AuthorAgeFilesLines
* Implement dummy expansions for builtin attributesLukas Wirth2021-06-091-1/+3
|
* Handle attribute macros in `descend_into_macros`Jonas Schievink2021-06-061-0/+5
|
* Return `ReachedFixedPoint::No` when resolving derive helperJonas Schievink2021-06-041-0/+1
|
* Make it opt-inJonas Schievink2021-06-031-0/+4
|
* Expand procedural attribute macrosJonas Schievink2021-06-031-6/+50
|
* Fall back to legacy preludeJonas Schievink2021-06-011-14/+27
|
* Implement per-edition preludesJonas Schievink2021-06-013-58/+173
|
* Merge #8866bors[bot]2021-05-311-2/+2
|\ | | | | | | | | | | | | | | 8866: Update salsa r=matklad a=jonas-schievink This updates salsa to include https://github.com/salsa-rs/salsa/pull/265, and removes all cancellation-related code from rust-analyzer Co-authored-by: Jonas Schievink <[email protected]>
| * Update salsaJonas Schievink2021-05-271-2/+2
| |
* | Diagnose unimplemented built-in macrosJonas Schievink2021-05-302-16/+41
| |
* | Thread proc-macro types through the HIRJonas Schievink2021-05-292-2/+17
| |
* | Test that `ItemTree` works as intendedJonas Schievink2021-05-271-1/+73
|/
* Stop expanding UseTrees during ItemTree loweringJonas Schievink2021-05-262-34/+48
|
* internal: move diagnostics to hirAleksey Kladov2021-05-253-45/+109
| | | | | | | | | | | | | | | | | | | | | | | The idea here is to eventually get rid of `dyn Diagnostic` and `DiagnosticSink` infrastructure altogether, and just have a `enum hir::Diagnostic` instead. The problem with `dyn Diagnostic` is that it is defined in the lowest level of the stack (hir_expand), but is used by the highest level (ide). As a first step, we free hir_expand and hir_def from `dyn Diagnostic` and kick the can up to `hir_ty`, as an intermediate state. The plan is then to move DiagnosticSink similarly to the hir crate, and, as final third step, remove its usage from the ide. One currently unsolved problem is testing. You can notice that the test which checks precise diagnostic ranges, unresolved_import_in_use_tree, was moved to the ide layer. Logically, only IDE should have the infra to render a specific range. At the same time, the range is determined with the data produced in hir_def and hir crates, so this layering is rather unfortunate. Working on hir_def shouldn't require compiling `ide` for testing.
* internal: intern `AttrInput`Jonas Schievink2021-05-241-1/+1
|
* Work around non-unique AttrIdsJonas Schievink2021-05-222-9/+39
|
* Remove `StructDefKind`Jonas Schievink2021-05-211-3/+3
|
* Don't lower extern block in the ItemTreeJonas Schievink2021-05-212-0/+37
|
* Support `#[register_attr]` and `#[register_tool]`Jonas Schievink2021-05-202-32/+92
|
* Rename `ignore_attrs_on` to `skip_attrs`Jonas Schievink2021-05-201-6/+6
|
* SimplifyJonas Schievink2021-05-201-4/+2
|
* Refactor name resolution to resolve derive helpersJonas Schievink2021-05-202-85/+135
|
* Rename `unexpanded_macros` to `unresolved_macros`Jonas Schievink2021-05-201-15/+31
|
* Track in-scope derive helpers during nameresJonas Schievink2021-05-191-8/+26
|
* Fix unresolved attribute fallback againJonas Schievink2021-05-192-4/+33
|
*-. Merge #8885 #8887bors[bot]2021-05-192-14/+35
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8885: internal: greatly simplify eager macro representation r=jonas-schievink a=jonas-schievink - Share structures with lazy macros, make both use `MacroCallLoc`. - Remove `intern_eager_expansion`, `EagerCallLoc`, `EagerMacroId`, and *many* matches on `MacroCallId`. - Make a lot of FIXMEs obsolete since the code no longer distinguishes between eager and lazy macros. - Add `EagerCallInfo`, which is `Some` for calls to eager macros and holds the argument or expansion result and the included file. 8887: fix: fix derive collection after unresolved attribute fallback r=jonas-schievink a=jonas-schievink Fixes https://github.com/rust-analyzer/rust-analyzer/pull/8882#issuecomment-844379170 bors r+ Co-authored-by: Jonas Schievink <[email protected]>
| | * Fix derive collection after unresolved attribute fallbackJonas Schievink2021-05-192-2/+26
| |/ |/|
| * Simplify eager macro representationJonas Schievink2021-05-191-12/+9
|/
* Merge #8882bors[bot]2021-05-191-27/+153
|\ | | | | | | | | | | | | | | | | | | | | | | 8882: internal: resolve attributes in name resolution (minimal version) r=jonas-schievink a=jonas-schievink Closes https://github.com/rust-analyzer/rust-analyzer/pull/7049 This should not have any observable effect, since we don't attempt to expand attribute macros yet, and I have implemented a fallback that treats items with unresolved attributes as if the attribute wasn't there. Derive helpers are not yet resolved. `#![register_{attr,tool}]` are not yet supported. Co-authored-by: Jonas Schievink <[email protected]>
| * Rewrite `resolve_imports` to use an iteratorJonas Schievink2021-05-191-19/+23
| | | | | | | | This allows reusing the original vector's allocation
| * Restructure nameres loop to be a bit clearerJonas Schievink2021-05-191-38/+41
| |
| * internal: resolve attributes in name resolutionJonas Schievink2021-05-191-2/+121
| |
* | Merge #8871bors[bot]2021-05-181-23/+13
|\ \ | | | | | | | | | | | | | | | | | | | | | 8871: internal: Simplify `DefCollector::resolve_macros` r=jonas-schievink a=jonas-schievink bors r+ Co-authored-by: Jonas Schievink <[email protected]>
| * | Simplify `DefCollector::resolve_macros`Jonas Schievink2021-05-181-23/+13
| |/
* | Added cov markivan7702021-05-172-1/+3
| |
* | Fix #8834ivan7702021-05-162-0/+19
|/
* Move `AttrId` back into `hir_def`Jonas Schievink2021-05-101-2/+2
|
* Test that none of the macros are reparsedJonas Schievink2021-05-091-0/+6
|
* Precompute macro fragment kindJonas Schievink2021-05-091-6/+14
|
* Update crates/hir_def/src/nameres/tests/incremental.rsAleksey Kladov2021-05-061-1/+1
| | | Co-authored-by: Jonas Schievink <[email protected]>
* internal: add failing incremental testAleksey Kladov2021-05-061-0/+52
|
* Merge #8542bors[bot]2021-04-162-6/+7
|\ | | | | | | | | | | | | | | 8542: Include path in `unresolved-macro-call` diagnostic r=matklad a=jonas-schievink Co-authored-by: Jonas Schievink <[email protected]>
| * Include path in `unresolved-macro-call` diagnosticJonas Schievink2021-04-162-6/+7
| |
* | Fix primitive shadowing with inner itemsJonas Schievink2021-04-161-1/+7
|/
* Resolve prelude and crate root names in the root DefMapJonas Schievink2021-04-092-7/+34
|
*-. Merge #8443 #8446bors[bot]2021-04-092-16/+15
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8443: Rewrite `#[derive]` removal code to be based on AST r=jonas-schievink a=jonas-schievink We now remove any `#[derive]` before and including the one we want to expand, in the `macro_arg` query. The same infra will be needed by attribute macros (except we only remove the attribute we're expanding, not any preceding ones). Part of https://github.com/rust-analyzer/rust-analyzer/issues/8434 (doesn't implement the cfg-expansion yet, because that's more difficult) 8446: Undo path resolution hack for extern prelude r=jonas-schievink a=jonas-schievink Reverts the change made in https://github.com/rust-analyzer/rust-analyzer/pull/7959 We don't populate the extern prelude for block DefMaps anymore, so this is unnecessary bors r+ Co-authored-by: Jonas Schievink <[email protected]>
| | * Undo path resolution hack for extern preludeJonas Schievink2021-04-091-9/+4
| |/ |/| | | | | | | We don't populate the extern prelude for block DefMaps anymore, so this is unnecessary
| * Store `#[derive]` attribute ID along macro invocJonas Schievink2021-04-091-7/+11
|/
* Use named fields in `MacroCallKind`Jonas Schievink2021-04-081-1/+1
|
* Track recursion limit when expanding custom deriveJonas Schievink2021-04-081-1/+1
|