Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | Merge #8352 | bors[bot] | 2021-04-05 | 1 | -9/+3 | |
|\ | | | | | | | | | | | | | | | 8352: Remove dead legacy macro expansion code r=lnicola a=brandondong I was investigating some unrelated macro issue when I noticed this dead code. This legacy macro expansion logic was changed in https://github.com/rust-analyzer/rust-analyzer/pull/8128. Co-authored-by: Brandon <[email protected]> | |||||
| * | Remove dead legacy macro expansion code | Brandon | 2021-04-05 | 1 | -9/+3 | |
| | | ||||||
* | | Use shrink_to_fit to reduce DefMap sizes | Jonas Schievink | 2021-04-03 | 1 | -1/+3 | |
| | | ||||||
* | | Intern `ModPath` in `Import` | Jonas Schievink | 2021-04-03 | 1 | -2/+6 | |
| | | | | | | | | Minor savings only | |||||
* | | Allow include! an empty content file | Edwin Cheng | 2021-04-03 | 1 | -0/+20 | |
| | | ||||||
* | | Support `#[rustc_builtin_macro = "builtin_name"]` | Jonas Schievink | 2021-04-03 | 1 | -1/+11 | |
| | | ||||||
* | | Only populate prelude for crate-level DefMaps | Jonas Schievink | 2021-04-02 | 1 | -14/+16 | |
| | | ||||||
* | | Intern Attr, MacroCall and Path components | Jonas Schievink | 2021-04-01 | 1 | -1/+1 | |
| | | ||||||
* | | Remove unused test fixtures | Edwin Cheng | 2021-03-28 | 1 | -4/+0 | |
| | | ||||||
* | | Basic Support Macro 2.0 | Edwin Cheng | 2021-03-27 | 2 | -39/+85 | |
|/ | ||||||
* | Merge bang-macros and derives in name resolution | Jonas Schievink | 2021-03-23 | 1 | -86/+79 | |
| | ||||||
* | resolver: manually traverse nested block scopes | Jonas Schievink | 2021-03-22 | 1 | -1/+1 | |
| | ||||||
* | Merge #8134 | bors[bot] | 2021-03-21 | 1 | -4/+9 | |
|\ | | | | | | | | | | | | | | | 8134: Correct the paths of submodules from the include! macro r=edwin0cheng a=sticnarf This PR should fix #7846. It mostly follows the instructions from @edwin0cheng in that issue. Co-authored-by: Yilin Chen <[email protected]> | |||||
| * | check is_include_macro only when attr_path is not specified | Yilin Chen | 2021-03-21 | 1 | -4/+3 | |
| | | | | | | | | Signed-off-by: Yilin Chen <[email protected]> | |||||
| * | use the included file as the source of expanded include macro | Yilin Chen | 2021-03-21 | 1 | -2/+8 | |
| | | | | | | | | Signed-off-by: Yilin Chen <[email protected]> | |||||
* | | Expand legacy-scoped macro during collection | Jonas Schievink | 2021-03-21 | 2 | -6/+28 | |
|/ | ||||||
* | Fix handling of `#![cfg]` in outline module file | Jonas Schievink | 2021-03-19 | 2 | -21/+48 | |
| | ||||||
* | Rename derive-specific APIs | Jonas Schievink | 2021-03-19 | 1 | -4/+4 | |
| | ||||||
* | Add test | Jonas Schievink | 2021-03-18 | 1 | -0/+26 | |
| | ||||||
* | Record custom derive helpers in `DefMap` | Jonas Schievink | 2021-03-18 | 2 | -24/+80 | |
| | | | | Also clean up proc macro attribute parsing a bit | |||||
* | Store an `AstId` for procedural macros | Jonas Schievink | 2021-03-18 | 1 | -6/+7 | |
| | ||||||
* | Make MacroDefId's `AstId` mandatory when possible | Jonas Schievink | 2021-03-18 | 1 | -4/+1 | |
| | ||||||
* | Rename `item_tree` query to `file_item_tree` | Jonas Schievink | 2021-03-18 | 1 | -4/+4 | |
| | ||||||
* | Make `ItemTreeId` its own type | Jonas Schievink | 2021-03-18 | 1 | -6/+6 | |
| | ||||||
* | Merge #8075 | bors[bot] | 2021-03-17 | 2 | -16/+37 | |
|\ | | | | | | | | | | | | | | | | | | | 8075: Fix `use crate as <name>;` imports r=jonas-schievink a=jonas-schievink Fixes https://github.com/rust-analyzer/rust-analyzer/issues/4644 bors r+ Co-authored-by: Jonas Schievink <[email protected]> | |||||
| * | Fix `use crate as <name>;` imports | Jonas Schievink | 2021-03-17 | 2 | -16/+37 | |
| | | ||||||
* | | Improve diagnostic when including nonexistent file | Jonas Schievink | 2021-03-17 | 1 | -1/+1 | |
|/ | ||||||
* | Use first early expansion error during nameres | Jonas Schievink | 2021-03-17 | 2 | -1/+20 | |
| | ||||||
* | Merge #7970 | bors[bot] | 2021-03-15 | 2 | -10/+68 | |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7970: Fix incorrect diagnostics for failing built in macros r=jonas-schievink a=brandondong **Reproduction:** 1. Use a built in macro in such a way that rust-analyzer fails to expand it. For example: **lib.rs** ``` include!("<valid file but without a .rs extension so it is not indexed by rust-analyzer>"); ``` 2. rust-analyzer highlights the macro call and says the macro itself cannot be resolved even though include! is in the standard library (unresolved-macro-call diagnostic). 3. No macro-error diagnostic is raised. **Root cause for incorrect unresolved-macro-call diagnostic:** 1. collector:collect_macro_call is able to resolve include! in legacy scope but the expansion fails. Therefore, it's pushed into unexpanded_macros to be retried with module scope. 2. include! fails at the resolution step in collector:resolve_macros now that it's using module scope. Therefore, it's retained in unexpanded_macros. 3. Finally, collector:finish tries resolving the remaining unexpanded macros but only with module scope. include! again fails at the resolution step so a diagnostic is created. **Root cause for missing macro-error diagnostic:** 1. In collector:resolve_macros, directive.legacy is None since eager expansion failed in collector:collect_macro_call. The macro_call_as_call_id fails to resolve since we're retrying in module scope. Therefore, collect_macro_expansion is not called for the macro and no macro-error diagnostic is generated. **Fix:** - In collector:collect_macro_call, do not add failing built-in macros to the unexpanded_macros list and immediately raise the macro-error diagnostic. This is in contrast to lazy macros which are resolved in collector::resolve_macros and later expanded in collect_macro_expansion where a macro-error diagnostic may be raised. Co-authored-by: Brandon <[email protected]> Co-authored-by: brandondong <[email protected]> | |||||
| * | Update crates/hir_def/src/nameres/collector.rs | brandondong | 2021-03-15 | 1 | -1/+1 | |
| | | | | | | Co-authored-by: Jonas Schievink <[email protected]> | |||||
| * | Fix incorrect diagnositics for failing built in eager macros | Brandon | 2021-03-14 | 2 | -10/+68 | |
| | | ||||||
* | | Extend cfg_attr test | Jonas Schievink | 2021-03-13 | 1 | -0/+3 | |
|/ | ||||||
* | Prefer names from outer DefMap over extern prelude | Jonas Schievink | 2021-03-10 | 1 | -5/+11 | |
| | ||||||
* | Delete `ContainerId` | Jonas Schievink | 2021-03-09 | 1 | -12/+11 | |
| | ||||||
* | Stop using `ContainerId` in `AssocContainerId` | Jonas Schievink | 2021-03-09 | 1 | -3/+3 | |
| | ||||||
* | Use upstream cov-mark | Laurențiu Nicola | 2021-03-08 | 8 | -36/+31 | |
| | ||||||
* | For unresolved macros, hightlight only the last segment | Aleksey Kladov | 2021-02-28 | 1 | -33/+48 | |
| | ||||||
* | Restrict visibilities to the containing DefMap | Jonas Schievink | 2021-02-28 | 1 | -4/+17 | |
| | ||||||
* | is_visible_from_def_map: handle block expressions | Jonas Schievink | 2021-02-23 | 1 | -2/+2 | |
| | ||||||
* | Fix resolution of `self` module within blocks | Jonas Schievink | 2021-02-05 | 1 | -1/+9 | |
| | ||||||
* | Fix merging of `segment_index` in path resolution | Jonas Schievink | 2021-02-05 | 1 | -2/+5 | |
| | ||||||
* | Make `ModPath`'s representation private | Jonas Schievink | 2021-02-04 | 2 | -12/+12 | |
| | ||||||
* | Don't keep the parent DefMap alive via Arc | Jonas Schievink | 2021-02-04 | 3 | -13/+23 | |
| | | | | | This seems like it could easily leak a lot of memory since we don't currently run GC | |||||
* | Use body lowering for block_def_map tests | Jonas Schievink | 2021-02-03 | 2 | -252/+2 | |
| | | | | Removes the hacky and buggy custom lowering code | |||||
* | Fix resolution of `crate` paths from within blocks | Jonas Schievink | 2021-02-02 | 1 | -2/+2 | |
| | | | | | They resolve to the crate root, not the DefMap's root module (which can be a block) | |||||
* | Use the right `DefMap` when looking up modules | Jonas Schievink | 2021-02-02 | 2 | -2/+16 | |
| | ||||||
* | Revert "Use block_def_map in body lowering" | Jonas Schievink | 2021-02-02 | 2 | -2/+252 | |
| | ||||||
* | Use body lowering for block_def_map tests | Jonas Schievink | 2021-02-01 | 2 | -252/+2 | |
| | | | | Removes the hacky and buggy custom lowering code | |||||
* | Honor #![macro_use] in mod source files | Lukas Wirth | 2021-01-31 | 2 | -8/+23 | |
| | ||||||
* | Fix incorrect `FileId` and remove broken shortcut | Jonas Schievink | 2021-01-28 | 1 | -7/+6 | |
| | | | | | Apparently we were using the crate's root file instead of the file containing the block. |