aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix #8834ivan7702021-05-162-0/+19
|
* Merge #8813bors[bot]2021-05-163-8/+79
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8813: Get some more array lengths! r=lf- a=lf- This is built on #8799 and thus contains its changes. I'll rebase it onto master when that one gets merged. It adds support for r-a understanding the length of: * `let a: [u8; 2] = ...` * `let a = b"aaa"` * `let a = [0u8; 4]` I have added support for getting the values of byte strings, which was not previously there. I am least confident in the correctness of this part and it probably needs some more tests, as we currently have only one test that exercised that part (!). Fixes #2922. Co-authored-by: Jade <[email protected]>
| * Address final feedbackJade2021-05-161-0/+8
| | | | | | | | | | * rename ConstExtension->ConstExt * refactor a manual construction of a Const
| * Add more tests, refactor array lengths/consteval workJade2021-05-141-0/+12
| | | | | | | | | | | | | | | | | | | | | | Fix #2922: add unknown length as a condition for a type having unknown. Incorporate reviews: * Extract some of the const evaluation workings into functions * Add fixmes on the hacks * Add tests for impls on specific array lengths (these work!!! 😁) * Add tests for const generics (indeed we don't support it yet)
| * Add support for lengths in array repeats, if they are literalsJade2021-05-132-4/+5
| | | | | | | | Now we will get the type of `[0u8; 4]`.
| * Support length for ByteStringsJade2021-05-131-1/+4
| | | | | | | | I am not confident that my added byte string parsing is right.
| * Add lowering of array lengths in typesJade2021-05-131-3/+50
| | | | | | | | | | | | | | | | | | | | | | Now e.g. ```rust fn a(b: [u8; 2]) { } ``` will know about the length of b.
* | Merge #8822bors[bot]2021-05-131-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 8822: minor: Cleanup imports r=Veykril a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | Cleanup importsAleksey Kladov2021-05-131-2/+2
| |/
* | Merge #8820bors[bot]2021-05-131-2/+11
|\ \ | |/ |/| | | | | | | | | | | 8820: fix: Return absolute paths in find_path if crate start is ambiguous r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <[email protected]>
| * Return absolute paths in find_path if crate start is ambiguousLukas Wirth2021-05-131-2/+11
| |
* | Merge #8398bors[bot]2021-05-113-10/+20
|\ \ | | | | | | | | | | | | | | | | | | | | | 8398: Fix inference with conditionally compiled tails r=flodiebold a=DJMcNab Fixes #8378 Co-authored-by: Daniel McNab <[email protected]>
| * | Fix inference with conditionally compiled tailsDaniel McNab2021-05-033-10/+20
| | | | | | | | | | | | Fixes #8378
* | | Rewrite `attr.rs` to allow using syntax-based indicesJonas Schievink2021-05-102-59/+84
| | |
* | | Move `AttrId` back into `hir_def`Jonas Schievink2021-05-103-6/+9
| |/ |/|
* | Test that none of the macros are reparsedJonas Schievink2021-05-091-0/+6
| |
* | Precompute macro fragment kindJonas Schievink2021-05-095-11/+29
| |
* | Reuse database in LowerCtxJonas Schievink2021-05-064-15/+11
| |
* | 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
| |
* | Don't store call-site text offsets in hygiene infoJonas Schievink2021-05-0612-63/+99
| |
* | Fix block comment intra doc link injection rangesLukas Tobias Wirth2021-05-041-4/+8
|/
* find_path: check only crate-level preludeJonas Schievink2021-04-301-2/+28
|
* Remove `ItemTree::all_inner_items`Jonas Schievink2021-04-211-7/+0
|
* Add failing local items testJonas Schievink2021-04-213-0/+46
|
* Fix some find_path bugs around inner itemsJonas Schievink2021-04-191-5/+58
|
* fix: false positive about inner attrs in docsAleksey Kladov2021-04-191-2/+2
| | | | closes #8541
* Merge #8462bors[bot]2021-04-197-36/+72
|\ | | | | | | | | | | | | | | 8462: Expand macros at type position r=jonas-schievink a=cynecx Co-authored-by: cynecx <[email protected]>
| * hir_ty: keep body::Expander in TyLoweringContextcynecx2021-04-182-45/+11
| |
| * hir_def: various cleanupscynecx2021-04-183-11/+9
| |
| * hir_def: refactor expand_macro_type and cleanupscynecx2021-04-172-120/+30
| |
| * hir_def: ignore ast::Type in file_item_tree querycynecx2021-04-172-10/+11
| |
| * hir_ty: Expand macros at type positioncynecx2021-04-178-49/+210
| |
* | Fix visibility of items in block modulesJonas Schievink2021-04-192-1/+21
|/
* Fix `TestDB::module_at_position` with submodulesJonas Schievink2021-04-172-2/+72
|
* Merge #8542bors[bot]2021-04-167-19/+39
|\ | | | | | | | | | | | | | | 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-167-19/+39
| |
* | Fix primitive shadowing with inner itemsJonas Schievink2021-04-161-1/+7
|/
* Remove unneeded annotations from find_path testsJonas Schievink2021-04-151-6/+0
|
* Make find_path tests adhere to style guideJonas Schievink2021-04-151-260/+327
|
* Merge #8432bors[bot]2021-04-131-0/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8432: decl_check: consider outer scopes' allows r=jonas-schievink a=lf- Fix #8417. Also makes it less noisy about no_mangle annotated stuff the user can do nothing about. Note: this still is broken with bitfield! macros. A repro in an ignore test is included here. I believe this bug is elsewhere, and I don't think I can work around it here. I would like help filing the remaining bug, as it does actually affect users, but I don't know how to describe the behaviour (or even if it is unintended). Co-authored-by: Jade <[email protected]>
| * decl_check: consider outer scopes' allowsJade2021-04-081-0/+10
| | | | | | | | | | | | | | | | | | Fix #8417. Also makes it less noisy about no_mangle annotated stuff the user can do nothing about. Note: this still is broken with bitfield! macros. A repro in an ignore test is included here. I believe this bug is elsewhere, and I don't think I can work around it here.
* | Support macros in pattern positionJonas Schievink2021-04-113-8/+33
| |
* | Avoid an unnecessary `collect`Jonas Schievink2021-04-091-3/+1
| |
* | Merge #8450bors[bot]2021-04-091-0/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 8450: Don't ignore unnamed consts when looking for definitions r=Veykril a=Veykril Fixes #8448 bors r+ Co-authored-by: Lukas Wirth <[email protected]>
| * | Insert unnamed consts to ChildBySource DynMapLukas Wirth2021-04-091-0/+4
| | |
* | | Resolve prelude and crate root names in the root DefMapJonas Schievink2021-04-092-7/+34
| | |
| | |
| \ \
*-. \ \ Merge #8443 #8446bors[bot]2021-04-095-35/+39
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-093-9/+15
| | |