Commit Graph

613 Commits

Author SHA1 Message Date
Jonas Schievink
66311e1262 Add TreeId to identify ItemTrees
With per-block `ItemTree`s, the file ID is not enough to identify an
`ItemTree`.
2021-07-19 14:53:18 +02:00
Kirill Bulatov
8a5b24eb7e Explicitly connect an ambiguous import path case logic with the test on it 2021-07-16 00:41:00 +03:00
Aleksey Kladov
6f269708e8 internal: get rid of a call to slow O(N) visibility_of function
Instead of inferring module's declared visibility by looking at the
scope of its parent, let's just remeber the declared visibility in the
DefMap.
2021-07-12 21:13:43 +03:00
Aleksey Kladov
a9d0d1414a internal: remove erroneous default impl 2021-07-12 20:18:07 +03:00
Aleksey Kladov
67a7dfda43 internal: remove deprecated fn 2021-07-12 20:05:09 +03:00
Aleksey Kladov
d40cf52e6d internal: perpare to remove ModuleData::default 2021-07-12 20:02:56 +03:00
Aleksey Kladov
107e07458c internal: remove erroneous Default impl for ModuleOrigin
In rust-analyzer, we avoid defualt impls for types which don't have
sensible, "empty" defaults. In particular, we avoid using invalid
indices for defaults and similar hacks.
2021-07-12 20:00:17 +03:00
Florian Diebold
b7bd45574a Add workaround for #9562
This treats the consts generated by older synstructure versions like
unnamed consts. We should remove this at some point (at least after
Chalk has switched).
2021-07-11 16:14:39 +02:00
Lukas Wirth
13d3928d0b Update list of safe intrinsics 2021-07-08 15:49:39 +02:00
Jonas Schievink
8bf4ecebfe Add a coverage mark 2021-07-05 17:06:16 +02:00
Jonas Schievink
835723ca67 Fix visibility computation with modules from the same block 2021-07-05 16:06:50 +02:00
Aleksey Kladov
86720f2953 minor: drop dummy authors field 2021-07-05 14:19:41 +03:00
bors[bot]
738dd6ed9f
Merge #9431
9431: internal: Implement TypeRef::ForLifetime r=flodiebold a=Veykril



Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-01 18:25:06 +00:00
bors[bot]
920b2c8630
Merge #9445
9445: fix: Fix nested macro in block defining items r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-07-01 17:21:34 +00:00
Jonas Schievink
28e4b10f46 Fix nested macro in block defining items 2021-07-01 19:20:42 +02:00
Jonas Schievink
33d5793f19 Add a simpler legacy macro scoping test 2021-07-01 17:28:42 +02:00
Lukas Wirth
af739731db Implement TypeRef::ForLifetime 2021-06-30 01:34:54 +02:00
Jonas Schievink
3ebceb71e3 Handle ::{self} imports 2021-06-28 20:13:33 +02:00
Lukas Wirth
254e8f38d0 Record attributes in attr_query for proc-macros 2021-06-28 19:16:38 +02:00
Aleksey Kladov
260a24d05e internal: count ItemScopes 2021-06-22 21:02:08 +03:00
Aleksey Kladov
4772cb6b30 minor: clarify naming 2021-06-22 20:56:52 +03:00
Clemens Wasser
47747cd412 Apply some clippy suggestions 2021-06-21 16:40:21 +02:00
Laurențiu Nicola
e3ce88f6f2 Minor clippy perf fixes 2021-06-18 14:40:51 +03:00
Lukas Wirth
95c8c65139 Nest all the or-patterns! 2021-06-17 17:37:14 +02:00
Aleksey Kladov
7786ab2d44 minor: add a test variation 2021-06-15 11:58:39 +03:00
Aleksey Kladov
3f4ad44082 internal: document that we don't #[ignore] tests 2021-06-15 11:46:47 +03:00
Aleksey Kladov
c2015e7d18 internal: more natural order of sources for TypeParam
We usually use first (left) variant of `Either` for "usual" case, and
use right for odd things. For example, pat source is Pat | SelfParam.
2021-06-14 22:42:43 +03:00
bors[bot]
7bff76d8ae
Merge #9249
9249: internal: remove def-level diagnostics tests r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-06-13 15:46:09 +00:00
Aleksey Kladov
4af7a35197 internal: remove def-level diagnostics tests 2021-06-13 18:45:38 +03:00
Aleksey Kladov
00303284b5 internal: refactor macro error 2021-06-13 18:41:04 +03:00
Aleksey Kladov
f85e383b94 internal: refactor inactive code diagnostics 2021-06-13 17:29:25 +03:00
bors[bot]
3d8df2aef8
Merge #9248
9248: internal: refactor unresolved macro call diagnostic r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-06-13 14:09:41 +00:00
Aleksey Kladov
fa9ed4e0ce internal: refactor unresolved macro call diagnostic 2021-06-13 17:08:54 +03:00
Aleksey Kladov
6d104de15a internal: refactor unresolved import diagnostic 2021-06-13 16:42:34 +03:00
bors[bot]
e6fa9b016f
Merge #9247
9247: internal: refactor unresolved extern crate diagnostic r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-06-13 13:06:27 +00:00
Aleksey Kladov
39f190b72c internal: refactor unresolved extern crate diagnostic 2021-06-13 16:05:43 +03:00
bors[bot]
3f53a5dd72
Merge #9245
9245: internal: start new diagnostics API r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-06-13 11:56:15 +00:00
Aleksey Kladov
efa069d288 internal: start new diagnostics API
At the moment, this moves only a single diagnostic, but the idea is
reafactor the rest to use the same pattern. We are going to have a
single file per diagnostic. This file will define diagnostics code,
rendering range and fixes, if any. It'll also have all of the tests.
This is similar to how we deal with assists.

After we refactor all diagnostics to follow this pattern, we'll probably
move them to a new `ide_diagnostics` crate.

Not that we intentionally want to test all diagnostics on this layer,
despite the fact that they are generally emitted in the guts on the
compiler. Diagnostics care to much about the end presentation
details/fixes to be worth-while "unit" testing. So, we'll unit-test only
the primary output of compilation process (types and name res tables),
and will use integrated UI tests for diagnostics.
2021-06-13 14:55:45 +03:00
bors[bot]
be9742809c
Merge #9244
9244: feat: Make block-local trait impls work r=flodiebold a=flodiebold

As long as either the trait or the implementing type are defined in the same block.

CC #8961

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-06-13 11:13:31 +00:00
Florian Diebold
5ca71a1990 Make block-local trait impls work
As long as either the trait or the implementing type are defined in the
same block.
2021-06-13 13:00:34 +02:00
Aleksey Kladov
546be18e3a internal: check that coverage marks are always paired 2021-06-13 13:13:26 +03:00
Maan2003
5ac6804bb3
cargo fmt 2021-06-13 09:48:15 +05:30
Maan2003
c50b4579ec
clippy::useless_return 2021-06-13 09:35:29 +05:30
Maan2003
75370312fb
clippy::redundant_closure 2021-06-13 09:29:36 +05:30
Maan2003
705f7e6e26
clippy::clone_on_copy 2021-06-13 09:27:19 +05:30
Maan2003
6cc6dee9e9
clippy::useless_conversion 2021-06-13 09:25:55 +05:30
Maan2003
c9b4ac5be4
clippy::redudant_borrow 2021-06-13 09:24:16 +05:30
Aleksey Kladov
0463d76a1f internal: cross-crate cov-marks 2021-06-12 23:40:52 +03:00
Jonas Schievink
99d40e7a3a Don't stringify cfg_attr-gated attributes
This preserves the assigned `TokenId`s
2021-06-11 18:34:30 +02:00
Kirill Bulatov
690cd95327 Reduce fst_path calls 2021-06-11 00:10:09 +03:00