Commit graph

260896 commits

Author SHA1 Message Date
Ali Bektas
abdad6f45c rename config::ConfigChange::other_errors to validation_errors 2024-07-23 15:54:39 +02:00
Ali Bektas
874564e5b9 Add FIXME to root ratoml tests. 2024-07-22 01:42:50 +02:00
Ali Bektas
65627d1c54 Apply changes to ratoml/fixes 2024-07-22 01:33:15 +02:00
Ali Bektas
ad4e35a048 Minor fixes for ratoml module
- Parse errors are reflected as such by defining a new variant called `ConfigError::ParseError`
- New error collection has been added to store config level agnostic errors.
2024-07-22 01:31:38 +02:00
bors
402e176f06 Auto merge of #17657 - Veykril:cfg-slim, r=lnicola
internal: Make `CfgExpr` slimmer
2024-07-21 15:50:31 +00:00
Lukas Wirth
272e595f48 Make CfgExpr slimmer 2024-07-21 14:50:44 +02:00
bors
9e3482bb43 Auto merge of #17656 - Veykril:flyimport-builtin-mod, r=Veykril
fix: Allow flyimport to import primitive shadowing modules

Fixes https://github.com/rust-lang/rust-analyzer/issues/16371
2024-07-21 11:35:12 +00:00
Lukas Wirth
a580bab18c fix: Allow flyimport to import primitive shadowing modules 2024-07-21 13:26:19 +02:00
bors
a852cd8f1a Auto merge of #17655 - Veykril:std-find-path, r=Veykril
More `find_path` improvements
2024-07-21 11:21:25 +00:00
Lukas Wirth
f08aae943a Optimize find_path for sysroot library search some more 2024-07-21 13:20:12 +02:00
Lukas Wirth
80dd021c4c Fix visited module tracking not clearing itself on backtracking 2024-07-21 12:17:50 +02:00
Lukas Wirth
d934433195 Use out parameter instead of return value for find_path choice 2024-07-21 11:32:48 +02:00
Lukas Wirth
5a02f69662 Fix using wrong length for max_len arg 2024-07-21 11:16:23 +02:00
Lukas Wirth
0ed9a5fd78 Specialize find_path local search 2024-07-21 11:10:15 +02:00
Lukas Wirth
66a4e55b3d Optimize find_path choice selection 2024-07-21 10:53:33 +02:00
bors
38352c5c9c Auto merge of #17653 - Veykril:std-find-path, r=Veykril
Prefer standard library paths over shorter extern deps re-exports

This should generally speed up path finding for std items as we no longer bother looking through all external dependencies. It also makes more sense to prefer importing std items from the std dependencies directly.

Fixes https://github.com/rust-lang/rust-analyzer/issues/17540
2024-07-21 07:24:38 +00:00
Lukas Wirth
cfdcaa7450 Prefer standard library paths over shorter extern deps re-exports 2024-07-21 09:14:17 +02:00
bors
449d4c471d Auto merge of #17650 - ObsidianMinor:fix/17645, r=Veykril
Fix path resolution for child mods of those expanded by `include!`

Child modules wouldn't use the correct candidate paths due to a branch that doesn't seem to be doing what it's intended to do. Removing the branch fixes the problem and all existing test cases pass.

Having no knowledge of how any of this works, I believe this fixes #17645. Using another test that writes the included mod directly into `lib.rs` instead, I found the difference can be traced to the candidate files we use to look up mods. A separate branch for if the file comes from an `include!` macro doesn't take into account the original mod we're contained within:

```rust
None if file_id.macro_file().map_or(false, |it| it.is_include_macro(db.upcast())) => {
    candidate_files.push(format!("{}.rs", name.display(db.upcast())));
    candidate_files.push(format!("{}/mod.rs", name.display(db.upcast())));
}
```

I'm not sure why this branch exists. Tracing the branch back takes us to 3bb9efb but it doesn't say *why* the branch was added. The test case that was added in this commit passes with the branch removed, so I think it's just superfluous at this point.
2024-07-21 06:17:14 +00:00
Sydney Acksman
e43b74a1f6 Fix path resolution for child mods of those expanded by include!
Child modules wouldn't use the correct candidate paths due to a branch that doesn't seem to be doing what it's intended to do. Removing the branch fixes the problem and all existing test cases pass.
2024-07-20 14:32:28 -05:00
bors
ea7f3671c0 Auto merge of #17649 - ShoyuVanilla:issue-17585, r=Veykril
fix: Panic in debug profile for tuple deconstruct with arity mismatch

Fixes #17585, which doesn't affect daily use cases but quite annoying in development of r-a itself like writing tests.

This PR applies similar approach as in #17534, skipping match usefulness check for patterns containing errors
2024-07-20 18:04:01 +00:00
Shoyu Vanilla
96b30036f1 fix: Panic in debug profile for tuple deconstruct with arity mismatch 2024-07-21 02:37:37 +09:00
bors
60dfe6cba5 Auto merge of #17646 - Veykril:dyn-parse, r=lnicola
Add missing dyn parse special cases in 2015 edition

There were a few more special cases to consider here -> https://github.com/rust-lang/reference/pull/1538
2024-07-20 14:22:45 +00:00
Lukas Wirth
38814ece18 Add missing dyn parse special cases in 2015 edition 2024-07-20 09:18:40 +02:00
bors
aa52c5d963 Auto merge of #17641 - nyurik:optimize-refs, r=Veykril
Avoid ref when using format! in compiler

Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing). Inlining format args prevents accidental `&` misuse.

See https://github.com/rust-lang/rust-clippy/issues/10851
2024-07-20 06:40:27 +00:00
Lukas Wirth
afa72d53e3
Keep references in format! when the target is unsized 2024-07-20 08:39:04 +02:00
bors
91b9739d12 Auto merge of #17642 - lnicola:typos, r=lnicola
minor: Fix some typos
2024-07-20 05:32:14 +00:00
Laurențiu Nicola
a7074e2ebc Fix some typos 2024-07-20 08:30:22 +03:00
bors
449517d52e Auto merge of #17635 - Young-Flash:block_exp, r=lnicola
feat: add inlay hint support for block expr with lifetime label

![block_expr_with_label](https://github.com/user-attachments/assets/efede15b-d2ba-4aad-9775-a795b6cd473b)

close https://github.com/rust-lang/rust-analyzer/issues/17582
2024-07-20 05:11:10 +00:00
Young-Flash
1669e930e1 minor: tweak comment 2024-07-20 09:33:23 +08:00
Young-Flash
7bff592cad internal: add test case for inlay hint support for block expr with lifetime label 2024-07-20 09:33:23 +08:00
Young-Flash
aee0e30bed feat: add inlay hint support for block expr with lifetime label 2024-07-20 09:33:23 +08:00
bors
b939d3bf30 Auto merge of #17639 - Veykril:salsa-perf, r=Veykril
Some more small salsa memory improvements

This does limit our lru limits to 2^16 but if you want to set them higher than that you might as well not set them at all. Also makes `LRU` opt-in per query now, allowing us to drop all the unnecessary LRU stuff for most queries
2024-07-19 18:45:16 +00:00
Yuri Astrakhan
2a8cc1db3a Avoid ref when using format! in compiler
Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing). Inlining format args prevents accidental `&` misuse.
2024-07-19 14:41:59 -04:00
Lukas Wirth
147a2eb4b6 Add back equality check that went missing 2024-07-19 20:39:09 +02:00
bors
166ba4d1cf Auto merge of #17640 - Veykril:parse-dyn, r=Veykril
Parse contextual dyn keyword properly in edition 2015

Turns out this is more important than I thought it would be given the metrics :)
2024-07-19 18:31:08 +00:00
Lukas Wirth
2e81e1fa23 Fix edition used for include macro parsing 2024-07-19 20:29:53 +02:00
Lukas Wirth
9357572d9b Parse contextual dyn keyword properly in edition 2015 2024-07-19 20:20:30 +02:00
Lukas Wirth
ddd1a8f402 Drop an unnecessary Arc::clone 2024-07-19 18:53:52 +02:00
Lukas Wirth
59ec98218f Regenerate files 2024-07-19 18:39:42 +02:00
Lukas Wirth
24e0d516a0 Make LRU opt-in 2024-07-19 18:38:08 +02:00
Lukas Wirth
f1741aad4b Remove duplicate information from interned::Slot 2024-07-19 17:52:49 +02:00
bors
95c48af734 Auto merge of #17638 - Veykril:salsa-perf, r=Veykril
perf: Reduce memory usage of salsa slots by 8 bytes
2024-07-19 15:48:57 +00:00
Lukas Wirth
9770d016f1 Reduce maximum LRU size to 2^16 entries, reducing memory footprint of LRU entries 2024-07-19 17:48:12 +02:00
Lukas Wirth
091dc26cda perf: Reduce memory usage of salsa slots by 8 bytes 2024-07-19 17:34:48 +02:00
bors
a75b6faa9e Auto merge of #17637 - jjoeldaniel:master, r=Veykril
internal: remove rust-analyzer.openFAQ

Removed no longer functional `rust-analyzer.openFAQ` command created in #17508
2024-07-19 15:34:43 +00:00
bors
d16acea62c Auto merge of #17622 - roife:fix-issue-17602, r=Veykril
fix: handle synonymous imports with different renaming in 'merge imports'

fix #17602
2024-07-19 15:16:02 +00:00
Joel Daniel Rico
346210bb1b remove rust-analyzer.openFAQ 2024-07-19 08:11:16 -07:00
bors
fd240c00e0 Auto merge of #17620 - Veykril:edition-aware-parser, r=Veykril
Edition aware parser

Fixes https://github.com/rust-lang/rust-analyzer/issues/16324 by allowing us to properly thread through the edition to the parser
2024-07-19 14:56:56 +00:00
Lukas Wirth
754f53ca1a Test macros doing edition dependent parsing 2024-07-19 16:43:58 +02:00
Lukas Wirth
62eba06591 Prevent generated runner module from being format checked 2024-07-19 16:01:47 +02:00