Commit graph

829 commits

Author SHA1 Message Date
Aleksey Kladov
b688d84a4b minor: add missing test
This test kills the following mutant:

diff --git a/crates/mbe/src/tt_iter.rs b/crates/mbe/src/tt_iter.rs
index 9d2b1da9a..055d9a733 100644
--- a/crates/mbe/src/tt_iter.rs
+++ b/crates/mbe/src/tt_iter.rs
@@ -134,7 +134,7 @@ impl<'a> TtIter<'a> {
         self.inner = self.inner.as_slice()[res.len()..].iter();
         let res = match res.len() {
             1 => Some(res[0].cloned()),
-            0 => None,
+            // 0 => None,
             _ => Some(tt::TokenTree::Subtree(tt::Subtree {
                 delimiter: None,
                 token_trees: res.into_iter().map(|it| it.cloned()).collect(),
2022-01-03 17:21:43 +03:00
bors[bot]
2e7170e07b
Merge #11166
11166: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-01-02 16:49:40 +00:00
Lukas Wirth
f31863b189 minor: Simplify 2022-01-02 17:37:16 +01:00
Aleksey Kladov
d846afdeef check top level entry point invariants 2022-01-02 18:41:32 +03:00
Aleksey Kladov
e78424846e enforce parsing invariant for patterns 2022-01-02 17:32:15 +03:00
Aleksey Kladov
7989d567e2 internal: more macro tests 2022-01-02 17:18:21 +03:00
Lukas Wirth
44d61766b5 internal: Record unresolved derive invocations in hir 2022-01-01 20:43:25 +01:00
Aleksey Kladov
287e748aa9 add expr tests 2022-01-01 18:58:30 +03:00
Aleksey Kladov
b5369927d7 parse empty statemet as statemetn 2021-12-29 20:04:36 +03:00
Aleksey Kladov
841cd30b45 Add test 2021-12-29 19:37:35 +03:00
Aleksey Kladov
ad4b02ecc0 add automated semicolon insertion test 2021-12-29 18:37:06 +03:00
Aleksey Kladov
afffa096f6 add TopEntryPoint 2021-12-28 17:00:55 +03:00
Lukas Wirth
e76e0e843d Simplify 2021-12-21 18:28:04 +01:00
Lukas Wirth
0b1c434d53 Deduplicate lower ctx hygiene field 2021-12-21 18:27:54 +01:00
bors[bot]
8dc3a270f6
Merge #11067
11067: internal: Store function param names in ItemTree r=Veykril a=Veykril

This prevents us reparsing source files for completions, sometimes slowing them down massively if the source file is not cached at the expense of a slightly bigger memory usage.

related info https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Completion.20performance

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-20 14:43:39 +00:00
Lukas Wirth
8eb7ee9099 Update test output 2021-12-20 15:43:15 +01:00
Lukas Wirth
cd9d76e0ca internal: Store function param names in ItemTree 2021-12-20 15:24:37 +01:00
bors[bot]
f46731a230
Merge #11028
11028: Bump MSRV (1.57) r=Veykril a=iDawer

This bumps MSRV on all crates to 1.57 except `la-arena`

#10986 requires >=1.57 

Co-authored-by: iDawer <ilnur.iskhakov.oss@outlook.com>
2021-12-20 13:45:35 +00:00
bors[bot]
7f28b49759
Merge #11043
11043: fix: fix incorrect mismatched argument count diagnostic with `std::arch` functions r=jonas-schievink a=jonas-schievink

Adds basic support for `#[rustc_legacy_const_generics]`.

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10009

Full support would involve actually checking call arguments against the right expected types.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2021-12-17 17:46:42 +00:00
Jonas Schievink
fcc76e93a0 Initial support for #[rustc_legacy_const_generics] 2021-12-17 18:45:56 +01:00
Laurențiu Nicola
8ad7c0439c Remove needless clones 2021-12-17 17:35:10 +02:00
Lukas Wirth
d3e538638a fix: Don't duplicate attribute completions 2021-12-17 15:22:53 +01:00
iDawer
676744be6e Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
bors[bot]
bc8efca0c8
Merge #10977
10977: fix: fix `concat!` with captured expression r=jonas-schievink a=jonas-schievink

Adds another hack on top of https://github.com/rust-analyzer/rust-analyzer/pull/10623 to fix `concat!`.

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10721

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2021-12-10 14:19:51 +00:00
Jonas Schievink
95ddeaed8e Fix concat! with captured expression 2021-12-10 15:17:31 +01:00
Lukas Wirth
067d87e8a9 Remove some allocs 2021-12-09 18:04:32 +01:00
Jonas Schievink
c0a30ff21d Move synstructure hack out of ItemTree lowering 2021-12-08 15:44:52 +01:00
Jonas Schievink
b365b6119c Treat extern blocks as item containers 2021-12-07 17:31:26 +01:00
bors[bot]
5c00c3e8d4
Merge #10921
10921: minor: Update list of safe intrinsics r=Veykril a=Veykril

Closes https://github.com/rust-analyzer/rust-analyzer/issues/4798
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-03 23:52:28 +00:00
Lukas Wirth
144200c821 minor: Update list of safe intrinsics 2021-12-04 00:51:50 +01:00
Lukas Wirth
8da850b6d5 Improve hover message for inert attributes 2021-12-03 20:28:15 +01:00
Lukas Wirth
e58af219a4 feat: Resolve builtin-attr and tools in ide layer 2021-12-03 16:32:17 +01:00
bors[bot]
2d0db312b5
Merge #10872
10872: ide_db: build symbol index from crate def map r=Veykril a=jhgg

fixes #4842, #10764

Is this looking correct? 👀 

- [x] build the symbol index based upon the CrateDefMap for the given crate in `crate_symbols`
   - [x] make it multi threaded again, and figure out how to cache each moduleid's symbol index in salsa.
   - [x] NavigationTarget for names in macros is wrong, need to figure out how to compute a text range in the original file id?
   - [x] cleanup some duped code
   - [x] collect macros from `ItemScope.declared_macros()` into symbol index.
        - [x] store declared macros in `ItemScope` so we can figure out where macros were defined for the index.  
   - [x] do something about `SymbolIndex::for_files` - ideally it should use the new module symbol index stuff. 
       - [x] delete `source_file_to_file_symbols` & co...
           - [x] figure out what to do about `library_symbols` 
           - [x] maybe... speed up the new `library_symbols` - the new impl is probably much slower, and definitely much less parallel. **deciding to do nothing here, we can optimize later if necerssary.** 
   - [x] fix failing test: `navigation_target::tests::test_nav_for_symbol` - notably the crate def map doesn't seem to find declarations inside function. 
       - [x] now a bunch of other tests are failing around auto_import & qualify_path handlers. :(
           - [x] need to assoc items in traits and impls
 

Co-authored-by: Jake Heinz <jh@discordapp.com>
2021-11-30 14:07:39 +00:00
Jake Heinz
6cf9969546 collect macro_rules! macros into macro declarations 2021-11-29 05:28:22 +00:00
Jake Heinz
1ed5699355 collect macros 2021-11-29 05:22:30 +00:00
Aleksey Kladov
ba414bc2ae minor: correct profiling name 2021-11-27 19:11:39 +03:00
Aleksey Kladov
a1aa8212ef minor: if-let-else to shorter match 2021-11-27 18:18:00 +03:00
Jake Heinz
0447be7589 wip 2021-11-27 11:25:05 +00:00
Jonas Schievink
c291e5e284 Use the right ItemTree when re-resolving attr 2021-11-26 03:57:25 +01:00
Jonas Schievink
3bb6f506ee Build per-block ItemTrees 2021-11-26 00:17:20 +01:00
Lukas Wirth
a9c4c6da4c Fix mbe::Shift::new not accounting for non-ident token ids 2021-11-22 18:00:32 +01:00
Lukas Wirth
64cb09ddea Add to macro testing infra to emit token map ids 2021-11-22 16:51:09 +01:00
Lukas Wirth
69782f55de Move incorrect case diagnostic things into their module 2021-11-20 17:25:57 +01:00
Lukas Wirth
91def936bc Replace Vec with Box in Path.generic_args field 2021-11-20 16:37:41 +01:00
Lukas Wirth
ceaec9d866 internal: Replace Vec with Box in hir Pat 2021-11-20 16:17:30 +01:00
Lukas Wirth
cc327774b7 internal: Replace Vec with Box in hir Expr 2021-11-20 16:00:45 +01:00
Jonas Schievink
9f4c26e780 Format Fn traits using parentheses 2021-11-19 19:58:00 +01:00
Lukas Wirth
ea03defeac fix: Diagnose invalid derive attribute input 2021-11-19 13:17:35 +01:00
Lukas Wirth
6757910934 fix: Diagnose using derive on non-adt items 2021-11-19 12:10:55 +01:00
Lukas Wirth
966cae384f minor: Simplify 2021-11-18 21:43:54 +01:00