aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def
Commit message (Collapse)AuthorAgeFilesLines
...
* | Refactor attributes API to allow handling cfg_attrJonas Schievink2020-12-188-114/+187
| |
* | Make `Attrs::from_attrs_owner` privateJonas Schievink2020-12-171-1/+1
| |
* | Add `AttrDefId::krate`Jonas Schievink2020-12-171-0/+30
|/ | | | Access to the containing crate will be needed to handle `cfg_attr`
* Remove `module_lang_items`Jonas Schievink2020-12-162-54/+30
| | | | | It isn't used anywhere except in `crate_lang_items`. Remove it to slightly reduce memory usage and simplify the code.
* Avoid querying attributes in item tree loweringJonas Schievink2020-12-163-38/+28
| | | | | | | | ItemTree is per-file, so there is no unique crate associated with it. This means that it cannot know the active CfgOptions and thus couldn't handle `cfg_attr`. Prepare it for `cfg_attr`s by avoiding accessing attributes.
* Merge #6896bors[bot]2020-12-165-31/+20
|\ | | | | | | | | | | | | | | | | | | | | | | 6896: Node-ify lifetimes r=jonas-schievink a=Veykril Let's see if this passes the tests 🤞 Depends on https://github.com/rust-analyzer/ungrammar/pull/15 Co-authored-by: Jonas Schievink <[email protected]> Co-authored-by: Jonas Schievink <[email protected]> Co-authored-by: Lukas Wirth <[email protected]>
| * Node-ify lifetimesLukas Wirth2020-12-165-31/+20
| |
* | Merge #6897bors[bot]2020-12-166-19/+102
|\| | | | | | | | | | | | | | | | | | | | | | | | | 6897: Basic support for macros 2.0 r=jonas-schievink a=jonas-schievink This adds support for (built-in-only) macros 2.0, and removes some hacks used for builtin derives, which are declared via macros 2.0 in libcore. First steps for https://github.com/rust-analyzer/rust-analyzer/issues/2248. Blocked on https://github.com/rust-analyzer/ungrammar/pull/16. Co-authored-by: Jonas Schievink <[email protected]> Co-authored-by: Jonas Schievink <[email protected]>
| * Make macro def krate mandatoryJonas Schievink2020-12-154-15/+38
| | | | | | | | Refactors builtin derive support to go through proper name resolution
| * Basic support for decl macros 2.0Jonas Schievink2020-12-154-5/+65
| |
* | Merge #6879bors[bot]2020-12-153-21/+35
|\ \ | |/ |/| | | | | | | | | | | 6879: Change HasChildSource::ChildId assoc item to generic param r=matklad a=Veykril Co-authored-by: Lukas Wirth <[email protected]>
| * Change HasChildSource::ChildId assoc item to generic paramLukas Wirth2020-12-153-21/+35
| |
* | Move to upstream `macro_rules!` modelJonas Schievink2020-12-155-118/+132
| |
* | Merge #6886bors[bot]2020-12-152-82/+137
|\ \ | |/ |/| | | | | | | | | | | 6886: Expand statements for macros in lowering r=matklad a=edwin0cheng Fixes #6811 Co-authored-by: Edwin Cheng <[email protected]>
| * Expand statements for mbe in loweringEdwin Cheng2020-12-152-82/+137
| |
* | Add LifetimeParam resolving to SemanticsLukas Wirth2020-12-143-26/+33
|/
* Ignore lifetime params in substitutionsLukas Wirth2020-12-131-1/+4
|
* Merge #6818bors[bot]2020-12-127-46/+118
|\ | | | | | | | | | | | | | | | | | | 6818: Add Lifetimes to the HIR r=matklad a=Veykril This doesn't handle resolve yet as I don't know yet how that will be used. I'll get to that once I start moving the lifetime reference PR to the hir. This also adds a new `hir` name type for lifetimes and labels, `hir::LifetimeName`. Co-authored-by: Lukas Wirth <[email protected]>
| * Add Lifetimes to the HIRLukas Wirth2020-12-117-46/+118
| |
* | Use Attrs::docs in NavigationTarget instead of DocCommentsOwnerLukas Wirth2020-12-111-1/+1
| |
* | Merge #6834bors[bot]2020-12-111-3/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6834: Use Attrs::docs in runnables instead of DocCommentsOwner r=kjeremy a=Veykril I figured that we should probably move as much of the doc usage to the HIR as possible hence this PR. If we should keep this AST-based feel free to close. This change does have the nice(but not really useful as I doubt anyones gonna write doc tests like these) side effect that these two doc string snippets allow being run now. ![image](https://user-images.githubusercontent.com/3757771/101945607-bf241400-3bee-11eb-96ce-ccae80028b1f.png) ![image](https://user-images.githubusercontent.com/3757771/101946375-2e9a0380-3bef-11eb-9950-e35168fdd048.png) Co-authored-by: Lukas Wirth <[email protected]>
| * | Use Attrs::docs in runnables instead of DocCommentsOwnerLukas Wirth2020-12-111-3/+3
| |/
* | Add upstream commit to builtin_attr.rsJonas Schievink2020-12-111-0/+2
| |
* | Add builtin attributes for use in nameresJonas Schievink2020-12-112-0/+429
|/
* Remove item tree testsJonas Schievink2020-12-102-441/+0
| | | | | They were useful during initial development of the item tree, but now just cause churn
* Ignore extern items in incorrect-case checkJonas Schievink2020-12-103-5/+17
|
* Introduce anchored_pathAleksey Kladov2020-12-092-5/+6
| | | | | They allow to represent paths like `#[path = "C:\path.rs"] mod foo;` in a lossless cross-platform & network-transparent way.
* Merge #6771bors[bot]2020-12-091-5/+47
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6771: Properly attach inner attributes in Attrs::new r=matklad a=Veykril Properly attach inner and outer attributes to the things they actually belong to in the HIR. ~~I can add some tests for this if wanted once I know where to put them/how to test for this.~~ Put some tests into `hover.rs`. So the following snippet ```rust mod foo { //! Hello } ``` now shows `Hello` on hover 🎉 Fixes #2148 Co-authored-by: Lukas Wirth <[email protected]>
| * Properly fetch inner and outer docs on hir-levelLukas Wirth2020-12-091-17/+25
| |
| * Properly fetch inner and outer attributes on hir-levelLukas Wirth2020-12-081-5/+39
| |
* | Merge #6774bors[bot]2020-12-091-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | 6774: Increment recursion count in Expander only on success r=lnicola a=Veykril Fixes #6764 Co-authored-by: Lukas Wirth <[email protected]>
| * | Properly decrement recursion count in ExpanderLukas Wirth2020-12-091-2/+2
| |/
* | Use `original_file_range` in `TestDB`Jonas Schievink2020-12-081-9/+3
| |
* | Add test for `$crate` in builtin macrosJonas Schievink2020-12-081-0/+28
| | | | | | | | Fixes #6716
* | Handle macros in `TestDB::check_diagnostics`Jonas Schievink2020-12-081-2/+9
|/
* Escape string literals in Attr::from_srcLukas Wirth2020-12-082-12/+6
|
* Replace Arc<[str]> with String in attr::DocumentationLukas Wirth2020-12-071-2/+2
|
* Keep doc attribute orderLukas Wirth2020-12-071-14/+26
|
* Remove raw pre and suffixes from string attr literalsLukas Wirth2020-12-071-2/+5
|
* Remove hir_def/docs.rs moduleLukas Wirth2020-12-073-83/+22
|
* Remove documentation queryLukas Wirth2020-12-073-51/+19
|
* Don't insert blank lines between doc attributesLukas Wirth2020-12-071-11/+11
|
* Make `compile_error!` message match upstream rustcJonas Schievink2020-12-031-1/+1
| | | | It only consists of the argument passed to it
* Fix proc macro token mappingJonas Schievink2020-12-031-2/+2
|
* Make `compile_error!` lazy and emit a diagnosticJonas Schievink2020-12-031-0/+6
|
* Give better diagnostic if `OUT_DIR` is unsetJonas Schievink2020-12-031-0/+3
|
* Update/Fix testsJonas Schievink2020-12-031-4/+15
|
* Propagate eager expansion errorsJonas Schievink2020-12-032-17/+54
|
* Test macro diagnostics in body loweringJonas Schievink2020-12-021-0/+41
|
* Merge #6698bors[bot]2020-12-021-2/+5
|\ | | | | | | | | | | | | | | | | | | | | | | 6698: Attach macro expansion errors to the right file r=jonas-schievink a=jonas-schievink Previously it attached them to the result of the macro expansion (or, if no result was produced, to the file containing the invocation). Always use the file containing the invocation. This doesn't seem to have any observable difference, but seems better in theory. bors r+ Co-authored-by: Jonas Schievink <[email protected]>