Commit Graph

1262 Commits

Author SHA1 Message Date
Lukas Wirth
3856648b52 fix: Don't panic on synthetic syntax in inference diagnostics 2024-02-26 17:46:03 +01:00
Lukas Wirth
91554e0ae7 fix: Fix modules in blocks not resolving in ide layer 2024-02-26 14:54:47 +01:00
Lukas Wirth
85203d9721 Render assoc item owner in hover for items other than functions 2024-02-20 13:16:12 +01:00
bors
2223b4fa71 Auto merge of #13112 - lowr:patch/auto-trait-bounds, r=Veykril
Setup infra for handling auto trait bounds disabled due to perf problems

This patch updates some of the partially-implemented functions of `ChalkContext as RustIrDatabase`, namely `adt_datum()` and `impl_provided_for()`. With those, we can now correctly work with auto trait bounds and distinguish methods based on them.

Resolves #7856 (the second code; the first one is resolved by #13074)

**IMPORTANT**: I don't think we want to merge this until #7637 is resolved. Currently this patch introduces A LOT of unknown types and type mismtaches as shown below. This is because we cannot resolve items like `hashbrown::HashMap` in `std` modules, leading to auto trait bounds on them and their dependents unprovable.

|crate (from `rustc-perf@c52ee6` except for r-a)|e3dc5a588f07d6f1d3a0f33051d4af26190abe9e|HEAD of this branch|
|---|---|---|
|rust-analyzer @ e3dc5a588f |exprs: 417528, ??ty: 907 (0%), ?ty: 114 (0%), !ty: 1|exprs: 417528, ??ty: 1704 (0%), ?ty: 403 (0%), !ty: 20|
|ripgrep|exprs: 62120, ??ty: 2 (0%), ?ty: 0 (0%), !ty: 0|exprs: 62120, ??ty: 132 (0%), ?ty: 58 (0%), !ty: 11|
|webrender/webrender|exprs: 94355, ??ty: 49 (0%), ?ty: 16 (0%), !ty: 2|exprs: 94355, ??ty: 429 (0%), ?ty: 130 (0%), !ty: 7|
|diesel|exprs: 132591, ??ty: 401 (0%), ?ty: 5129 (3%), !ty: 31|exprs: 132591, ??ty: 401 (0%), ?ty: 5129 (3%), !ty: 31|
2024-02-19 16:45:59 +00:00
Rose Hudson
a492d9d164 feat: add unresolved-ident diagnostic 2024-02-19 14:12:18 +01:00
Rose Hudson
5390e4ce9b feat: add non-exhaustive-let diagnostic 2024-02-19 12:36:30 +01:00
Young-Flash
f3d84e86c8 minor: fix typo 2024-02-19 18:12:08 +08:00
Ryo Yoshida
4940017716 Rename StructDatum -> AdtDatum 2024-02-14 13:50:44 +01:00
Tavo Annus
125791386d Cleanup term search related changes 2024-02-11 14:35:54 +02:00
Tavo Annus
88964c0b6a Optionally disable term search for autocompletion 2024-02-11 13:33:29 +02:00
Tavo Annus
0b838e3e23 Expand target for autocompletion 2024-02-11 13:33:29 +02:00
Tavo Annus
a946970e2d Add quantified trees to reduce autocomplete options 2024-02-11 13:33:29 +02:00
Tavo Annus
bdbdd83ec1 Initial version of term_search for autocomplete 2024-02-11 13:33:29 +02:00
Tavo Annus
627255dd5a Add static method tactic 2024-02-11 13:33:29 +02:00
Tavo Annus
35eb0dbbc0 Add more documentation for term search 2024-02-11 13:33:29 +02:00
Tavo Annus
bb3c7cff60 Introduce term search to rust-analyzer 2024-02-11 13:33:29 +02:00
Lukas Wirth
5136705fad internal: Remove SELF_REF hack for self referential SyntaxContexts 2024-02-10 16:20:02 +01:00
bors
1ef7a2329b Auto merge of #16525 - Veykril:item-loc, r=Veykril
Abstract more over ItemTreeLoc-like structs

Allows reducing some code duplication by using functions generic over said structs. The diff isn't negative due to me adding some additional impls for completeness.
2024-02-10 10:47:37 +00:00
Lukas Wirth
00303c3b67 Abstract over ItemTreeLoc 2024-02-10 11:37:59 +01:00
Lukas Wirth
2ebf0c87c2 Deduplicate some code 2024-02-10 01:51:22 +01:00
Tetsuharu Ohzeki
eba1b13295 hir: Fix warnings about clippy str_to_string rule 2024-02-10 01:00:40 +09:00
Tetsuharu Ohzeki
7669619f9a clippy: Enable self_named_constructors rule 2024-02-09 22:31:21 +09:00
davidsemakula
602acfcb70 fix conflicting "unnecessary else" and "trailing return" diagnostics tests 2024-02-08 19:32:53 +03:00
davidsemakula
a250c2dde0 refactor remove trailing return diagnostic 2024-02-08 19:32:53 +03:00
davidsemakula
98e6f43a2f remove trailing return in trailing match expression 2024-02-08 19:32:53 +03:00
davidsemakula
2987fac76f diagnostic to remove trailing return 2024-02-08 19:32:53 +03:00
bors
0e5766b0d8 Auto merge of #16477 - davidsemakula:trait-incorrect-case-diagnostic, r=Veykril
feat: Add incorrect case diagnostics for traits and their associated items

Updates incorrect case diagnostic to:
- Check traits and their associated items
- Ignore trait implementations except for patterns in associated function bodies

Also cleans up `hir-ty::diagnostics::decl_check` a bit (mostly to make it a bit more DRY and easier to maintain)

Also fixes: #8675 and fixes: #8225
2024-02-08 14:40:16 +00:00
bors
e9d3565cd1 Auto merge of #16502 - davidsemakula:unnecessary-else-diagnostic, r=Veykril
feat: Add "unnecessary else" diagnostic and fix

Fixes #9457
2024-02-08 14:25:00 +00:00
Lukas Wirth
81ea48a573 fix: Fix tuple structs not rendering visibility in their fields 2024-02-08 10:05:28 +01:00
davidsemakula
62cc4f9c46 add unnecessary else diagnostic 2024-02-06 19:00:10 +03:00
bors
66cec4d11a Auto merge of #16470 - Veykril:clippy-disallow, r=lnicola
internal: Lint debug prints and disallowed types with clippy
2024-02-05 17:20:43 +00:00
bors
3e47532dd4 Auto merge of #16474 - davidbarsky:david/import-on-the-fly-improvements, r=lnicola
internal: even more `tracing`

As part of profiling completions, I added some additional spans and moved `TyBuilder::subst_for_def` closer to its usage site (the latter had a small impact on completion performance. Thanks for the tip, Lukas!)
2024-02-05 09:01:58 +00:00
davidsemakula
080d223dd4 incorrect case diagnostics for type aliases 2024-02-02 17:07:08 +03:00
davidsemakula
6d2d6323ac incorrect case diagnostics for trait assoc functions and consts 2024-02-02 17:07:08 +03:00
David Barsky
f9bef39d48 internal: add some more tracing spans inside of hir-ty 2024-02-01 16:10:32 -05:00
Lukas Wirth
9e8a0fae0c Lint debug prints and disallowed types with clippy 2024-02-01 17:57:27 +01:00
Johann Hemmann
b73ee2f50d useless_conversion 2024-01-31 19:06:18 +01:00
Johann Hemmann
c4302eaa56 unnecessary_lazy_evaluations 2024-01-31 19:06:18 +01:00
Johann Hemmann
de6f9561f2 unnecessary_cast 2024-01-31 19:06:18 +01:00
Johann Hemmann
daa20725c5 toplevel_ref_arg 2024-01-31 19:06:18 +01:00
Lukas Wirth
d252247ab7 internal: Remove unnecessary usages of ExpansionInfo 2024-01-31 09:57:17 +01:00
David Barsky
e1ea7c8844 internal: switch to tracing from log
This commit also adds `tracing` to NotificationDispatcher/RequestDispatcher,
bumps `rust-analyzer-salsa` to 0.17.0-pre.6, `always-assert` to 0.2, and
removes the homegrown `hprof` implementation in favor of a vendored
tracing-span-tree.
2024-01-30 12:27:31 -05:00
Johann Hemmann
43b1ae0446 cargo clippy --fix 2024-01-30 14:50:21 +01:00
bors
11b401d0b4 Auto merge of #16447 - Veykril:mir-errors, r=Veykril
intenral: Cleanup error variants in MIR code a bit
2024-01-30 11:38:41 +00:00
bors
22b6f9679d Auto merge of #16439 - wasd96040501:feat/gotodef3, r=Veykril
feat: Support for GOTO def from *inside* files included with include! macro

close #14937
Try to implement goto def from *inside* files included with include! macro.
This implementation has two limitations:
1. Only **one** file which calls include! will be tracked. (I think multiple file be included is a rare case and we may let it go for now)
2. Mapping token from included file to macro call file (semantics.rs:646~658) works fine but I am not sure is this the correct way to implement.
2024-01-30 11:27:18 +00:00
Lukas Wirth
5860763f18 Cleanup error variants in MIR code slightly 2024-01-30 09:53:39 +01:00
YangzeLuo
b22e772cab feat: Support for GOTO def from *inside* files included with include! macro 2024-01-27 23:36:01 +08:00
Lukas Wirth
6cf7b5f8d7 Don't parse intra doc links as syntax trees 2024-01-26 20:00:47 +01:00
Lukas Wirth
5a343415e8 Add some size assertions 2024-01-26 19:28:39 +01:00
Johann Hemmann
71d4dba960 redundant_pattern_matching 2024-01-19 17:31:01 +01:00