]>
git.lizzy.rs Git - rust.git/log
bors[bot] [Wed, 27 Nov 2019 18:45:05 +0000 (18:45 +0000)]
Merge #2430
2430: rename ra_ide_api -> ra_ide r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 18:44:38 +0000 (21:44 +0300)]
Reformat
Aleksey Kladov [Wed, 27 Nov 2019 18:32:33 +0000 (21:32 +0300)]
rename ra_ide_api -> ra_ide
Aleksey Kladov [Wed, 27 Nov 2019 18:31:51 +0000 (21:31 +0300)]
Rename module_id -> local_id
bors[bot] [Wed, 27 Nov 2019 18:27:45 +0000 (18:27 +0000)]
Merge #2429
2429: Move type inference to a separate crate r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 18:23:31 +0000 (21:23 +0300)]
prune deps
Aleksey Kladov [Wed, 27 Nov 2019 14:46:02 +0000 (17:46 +0300)]
Move Ty
Aleksey Kladov [Wed, 27 Nov 2019 13:48:48 +0000 (16:48 +0300)]
Decouple
bors[bot] [Wed, 27 Nov 2019 13:41:55 +0000 (13:41 +0000)]
Merge #2428
2428: Remove TypableDef r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 13:39:58 +0000 (16:39 +0300)]
Remove TypableDef
Aleksey Kladov [Wed, 27 Nov 2019 13:29:11 +0000 (16:29 +0300)]
Cleanup imports
Aleksey Kladov [Wed, 27 Nov 2019 13:25:01 +0000 (16:25 +0300)]
Use Id for variats
Aleksey Kladov [Wed, 27 Nov 2019 13:02:33 +0000 (16:02 +0300)]
More decoupling
Aleksey Kladov [Wed, 27 Nov 2019 12:56:20 +0000 (15:56 +0300)]
Decouple more
bors[bot] [Wed, 27 Nov 2019 09:51:02 +0000 (09:51 +0000)]
Merge #2427
2427: Decouple r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 09:47:18 +0000 (12:47 +0300)]
Decouple
bors[bot] [Wed, 27 Nov 2019 09:34:54 +0000 (09:34 +0000)]
Merge #2426
2426: Decouple r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 09:31:40 +0000 (12:31 +0300)]
Decouple
Aleksey Kladov [Wed, 27 Nov 2019 09:13:07 +0000 (12:13 +0300)]
Cleanup imports
bors[bot] [Wed, 27 Nov 2019 09:05:39 +0000 (09:05 +0000)]
Merge #2425
2425: Decouple r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 09:02:54 +0000 (12:02 +0300)]
Decouple
Aleksey Kladov [Wed, 27 Nov 2019 08:40:10 +0000 (11:40 +0300)]
Decouple
bors[bot] [Wed, 27 Nov 2019 06:51:37 +0000 (06:51 +0000)]
Merge #2424
2424: Crate -> CrateId r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 27 Nov 2019 06:42:55 +0000 (09:42 +0300)]
Crate -> CrateId
bors[bot] [Tue, 26 Nov 2019 21:02:32 +0000 (21:02 +0000)]
Merge #2422
2422: Use a simple progress bar instead of indicatif r=maklad a=edwin0cheng
![pb](https://user-images.githubusercontent.com/
11014119 /
69669230 -
6a3d5a80 -10cc-11ea-8ad7-
4dccb10349c9 .gif)
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Edwin Cheng [Tue, 26 Nov 2019 21:01:13 +0000 (05:01 +0800)]
Fill all last text to space and return the cursor
Edwin Cheng [Tue, 26 Nov 2019 20:33:40 +0000 (04:33 +0800)]
Remove progress bar and add a true counter
Edwin Cheng [Tue, 26 Nov 2019 20:16:03 +0000 (04:16 +0800)]
Remove commented code
Edwin Cheng [Tue, 26 Nov 2019 20:09:30 +0000 (04:09 +0800)]
Use a simple progress bar instead of indicatif
bors[bot] [Tue, 26 Nov 2019 19:56:35 +0000 (19:56 +0000)]
Merge #2421
2421: Cleanup r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 26 Nov 2019 19:56:07 +0000 (22:56 +0300)]
Cleanup
Aleksey Kladov [Tue, 26 Nov 2019 19:26:47 +0000 (22:26 +0300)]
Decouple
bors[bot] [Tue, 26 Nov 2019 18:42:52 +0000 (18:42 +0000)]
Merge #2420
2420: Remove last traces of adt from Ty r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
bors[bot] [Tue, 26 Nov 2019 18:34:15 +0000 (18:34 +0000)]
Merge #2418
2418: Hide MacroCallLoc outside hir_expand r=matklad a=edwin0cheng
This PR refactor `MacroCallLoc` such that it be hided to become implementation details of hir_expand.
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Aleksey Kladov [Tue, 26 Nov 2019 18:25:17 +0000 (21:25 +0300)]
Remove last traces of adt from Ty
Aleksey Kladov [Tue, 26 Nov 2019 18:18:26 +0000 (21:18 +0300)]
More precise NameKind::Self
bors[bot] [Tue, 26 Nov 2019 18:07:21 +0000 (18:07 +0000)]
Merge #2419
2419: Remove ns-polymorphic type_for_def r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 26 Nov 2019 18:04:24 +0000 (21:04 +0300)]
Remove ns-polymorphic type_for_def
Edwin Cheng [Tue, 26 Nov 2019 17:33:08 +0000 (01:33 +0800)]
Hide MacroCallLoc
bors[bot] [Tue, 26 Nov 2019 16:31:20 +0000 (16:31 +0000)]
Merge #2415
2415: Add note r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 26 Nov 2019 16:30:57 +0000 (19:30 +0300)]
Add note
Aleksey Kladov [Tue, 26 Nov 2019 15:06:12 +0000 (18:06 +0300)]
Cleanup imports
Aleksey Kladov [Tue, 26 Nov 2019 15:02:50 +0000 (18:02 +0300)]
Reduce visibility
Aleksey Kladov [Tue, 26 Nov 2019 15:00:36 +0000 (18:00 +0300)]
Use TraitId in TraitRef
bors[bot] [Tue, 26 Nov 2019 14:45:31 +0000 (14:45 +0000)]
Merge #2413
2413: Remove another helper r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 26 Nov 2019 14:42:21 +0000 (17:42 +0300)]
Remove another helper
Aleksey Kladov [Tue, 26 Nov 2019 14:26:08 +0000 (17:26 +0300)]
Doc
Aleksey Kladov [Tue, 26 Nov 2019 14:21:29 +0000 (17:21 +0300)]
Remove assoc_type_by_name helper
Aleksey Kladov [Tue, 26 Nov 2019 14:12:16 +0000 (17:12 +0300)]
Store names in TraitData
Aleksey Kladov [Tue, 26 Nov 2019 13:59:24 +0000 (16:59 +0300)]
Detangle ty from traits a bit
bors[bot] [Tue, 26 Nov 2019 13:26:23 +0000 (13:26 +0000)]
Merge #2412
2412: Fix stale crates that snuck in r=kjeremy a=kjeremy
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
Jeremy Kolb [Tue, 26 Nov 2019 13:20:40 +0000 (08:20 -0500)]
Fix stale crates that snuck in
bors[bot] [Tue, 26 Nov 2019 13:18:03 +0000 (13:18 +0000)]
Merge #2406
2406: Add hygiene information to SourceAnalyzer r=matklad a=edwin0cheng
This should fix https://github.com/rust-analyzer/rust-analyzer/pull/2392#issuecomment-
557964686
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Edwin Cheng [Tue, 26 Nov 2019 13:13:36 +0000 (21:13 +0800)]
Remove dbg!
bors[bot] [Tue, 26 Nov 2019 12:42:15 +0000 (12:42 +0000)]
Merge #2410
2410: Introduce hir_ty r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 26 Nov 2019 12:40:55 +0000 (15:40 +0300)]
Doc primitives
Aleksey Kladov [Tue, 26 Nov 2019 12:27:33 +0000 (15:27 +0300)]
id-ify impls_in_crate_query
bors[bot] [Tue, 26 Nov 2019 12:31:24 +0000 (12:31 +0000)]
Merge #2411
2411: Update parking_lot and smallvec to drop some dependencies r=matklad a=kjeremy
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
Jeremy Kolb [Tue, 26 Nov 2019 12:29:28 +0000 (07:29 -0500)]
Update parking_lot and smallvec to drop some dependencies
Aleksey Kladov [Tue, 26 Nov 2019 11:35:23 +0000 (14:35 +0300)]
Introduce hir_ty
bors[bot] [Tue, 26 Nov 2019 11:32:09 +0000 (11:32 +0000)]
Merge #2409
2409: Id-ify Ty::Adt r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 26 Nov 2019 11:29:12 +0000 (14:29 +0300)]
Id-ify Ty::Adt
bors[bot] [Tue, 26 Nov 2019 11:05:05 +0000 (11:05 +0000)]
Merge #2398
2398: WIP: introduce hir::Type r=matklad a=matklad
This introduces `hir::Type` wrapper over `hir::Ty`, with two purposes:
* bind `Ty` and it's corresponding environment
* Am I correct that `Ty` without an env doesn't make much sense, because the meaning of type parameters is unclear
* Am I correct that we can safely re-use the same environment for all types derived from the given type?
* hide representation defails of `Ty`. Specifically, I want to change `Ty::Adt` to use `hir_def::AdtId` instead of `hir::Adt`, but IDE doesn't know about underlying IDs. More generally, I feel like IDE shouldn't know that `Ty` is enum.
@flodiebold what do you think about this?
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 26 Nov 2019 11:02:57 +0000 (14:02 +0300)]
Introduce hir::Type
It should provide a convenient API over more low-level Ty
bors[bot] [Tue, 26 Nov 2019 08:46:48 +0000 (08:46 +0000)]
Merge #2408
2408: Use chalk fork to paper over #2052 r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 26 Nov 2019 08:45:12 +0000 (11:45 +0300)]
Use chalk fork to paper over #2052
bors[bot] [Tue, 26 Nov 2019 08:29:53 +0000 (08:29 +0000)]
Merge #2407
2407: :arrow_up: salsa r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 26 Nov 2019 08:29:20 +0000 (11:29 +0300)]
:arrow_up: salsa
Edwin Cheng [Tue, 26 Nov 2019 07:05:53 +0000 (15:05 +0800)]
Add hygiene information to SourceAnalyzer
bors[bot] [Mon, 25 Nov 2019 15:58:54 +0000 (15:58 +0000)]
Merge #2404
2404: Use TypeAliasId in Ty, pt 2 r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 25 Nov 2019 15:58:17 +0000 (18:58 +0300)]
Use TypeAliasId in Ty, pt 2
Aleksey Kladov [Mon, 25 Nov 2019 15:44:36 +0000 (18:44 +0300)]
Use TypeAliasId in Ty, pt 1
Aleksey Kladov [Mon, 25 Nov 2019 15:31:48 +0000 (18:31 +0300)]
More ids in Ty
bors[bot] [Mon, 25 Nov 2019 14:51:17 +0000 (14:51 +0000)]
Merge #2403
2403: Fixme for union fields r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 25 Nov 2019 14:34:15 +0000 (17:34 +0300)]
Fixme for union fields
Aleksey Kladov [Mon, 25 Nov 2019 14:30:50 +0000 (17:30 +0300)]
Fix hir for ast::UnionDef
Aleksey Kladov [Mon, 25 Nov 2019 13:55:09 +0000 (16:55 +0300)]
Introduce dedicated AST node for union
Although structs and unions have the same syntax and differ only in
the keyword, re-using the single syntax node for both of them leads to
confusion in practice, and propagates further down the hir in an
upleasent way.
Moreover, static and consts also share syntax, but we use different
nodes for them.
bors[bot] [Mon, 25 Nov 2019 13:42:36 +0000 (13:42 +0000)]
Merge #2388
2388: Show missing struct fields in the error message r=matklad a=Frizi
This provides the most interesting information about the "missing structure fields" error directly to the user.
Co-authored-by: Frizi <frizi09@gmail.com>
bors[bot] [Mon, 25 Nov 2019 13:34:12 +0000 (13:34 +0000)]
Merge #2402
2402: Use ids for Callable r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 25 Nov 2019 13:26:52 +0000 (16:26 +0300)]
Use ids for Callable
bors[bot] [Mon, 25 Nov 2019 13:23:27 +0000 (13:23 +0000)]
Merge #2401
2401: Update crates r=matklad a=kjeremy
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
Aleksey Kladov [Mon, 25 Nov 2019 13:16:41 +0000 (16:16 +0300)]
Use more IDs
Jeremy Kolb [Mon, 25 Nov 2019 13:12:28 +0000 (08:12 -0500)]
Update crates
bors[bot] [Mon, 25 Nov 2019 12:57:53 +0000 (12:57 +0000)]
Merge #2400
2400: Use GenericDefIdMore r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 25 Nov 2019 12:41:53 +0000 (15:41 +0300)]
Use GenericDefIdMore
bors[bot] [Mon, 25 Nov 2019 12:39:45 +0000 (12:39 +0000)]
Merge #2399
2399: Use GenericDefId more r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 25 Nov 2019 12:39:12 +0000 (15:39 +0300)]
Use GenericDefId more
bors[bot] [Mon, 25 Nov 2019 10:12:03 +0000 (10:12 +0000)]
Merge #2397
2397: Remove Resolver from autoderef r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 25 Nov 2019 10:10:26 +0000 (13:10 +0300)]
Remove Resolver from autoderef
Resolver holds onto too much context, including local scopes. Let's
try to pass in only what is necessary -- the trait environment.
Aleksey Kladov [Mon, 25 Nov 2019 09:45:45 +0000 (12:45 +0300)]
Push resolver up
bors[bot] [Mon, 25 Nov 2019 04:51:42 +0000 (04:51 +0000)]
Merge #2362
2362: Expand compile_error! r=edwin0cheng a=kjeremy
Does not validate that the input is a string literal. I thought that I could `match_ast!` against the `macro_args` but that did not work. Even if it had I am not sure which error would be appropriate.
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
bors[bot] [Mon, 25 Nov 2019 02:42:17 +0000 (02:42 +0000)]
Merge #2392
2392: Fix panic during the expansion of `column!` r=edwin0cheng a=marcogroppo
Fixes #2379. Well, this isn't the "proper" fix but it doesn't hurt, IMHO.
The problem is that `to_col_number`, called by `column_expand`, receives a position number that isn't included in the text range of the file. My (very limited) understanding is that the text is the one of the original file, while `pos` is relative to something else, probably the text of the macro. Notice that in this case the `column!` expansion seems to be triggered by `assert_eq!`, so we're in the middle of another expansion. This PR simply avoids the panic by checking the length of the text.
r? @edwin0cheng
Co-authored-by: Marco Groppo <marco.groppo@gmail.com>
Jeremy Kolb [Mon, 25 Nov 2019 00:01:51 +0000 (19:01 -0500)]
Expand compile_error!
Marco Groppo [Sun, 24 Nov 2019 18:02:04 +0000 (19:02 +0100)]
Fix panic during the expansion of `column!`
bors[bot] [Sun, 24 Nov 2019 21:45:26 +0000 (21:45 +0000)]
Merge #2396
2396: Switch to variant-granularity field type inference r=flodiebold a=matklad
r? @flodiebold
Previously, we had a `ty` query for each field. This PR switcthes to a query per struct, which returns an `ArenaMap` with `Ty`s.
I don't know which approach is better. What is bugging me about the original approach is that, if we do all queries on the "leaf" defs, in practice we get a ton of queries which repeatedly reach into the parent definition to compute module, resolver, etc. This *seems* wasteful (but I don't think this is really what causes any perf problems for us).
At the same time, I've been looking at Kotlin, and they seem to use the general pattern of analyzing the *parent* definition, and storing info about children into a `BindingContext`.
I don't really which way is preferable. I think I want to try this approach, where query granularity generally mirrors the data granularity. The primary motivation for me here is probably just hope that we can avoid adding a ton of helpers to a `StructField`, and maybe in general avoid the need to switch to a global `StructField`, using `LocalStructFieldId` most of the time internally.
For external API (ie, for `ra_ide_api`), I think we should continue with fine-grained `StructField::ty` approach, which internally fetches the table for the whole struct and indexes into it.
In terms of actual memory savings, the results are as follows:
```
This PR:
142kb FieldTypesQuery (deps)
38kb FieldTypesQuery
Status Quo:
208kb TypeForFieldQuery (deps)
18kb TypeForFieldQuery
```
Note how the table itself occupies more than twice as much space! I don't have an explanation for this: a plausible hypothesis is that single-field structs are very common and for them the table is a pessimisation.
THere's noticiable wallclock time difference.
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 24 Nov 2019 20:48:39 +0000 (23:48 +0300)]
Switch to variant-granularity field type inference
bors[bot] [Sun, 24 Nov 2019 19:52:15 +0000 (19:52 +0000)]
Merge #2394
2394: Implement HasModule for AdtId r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 24 Nov 2019 19:47:58 +0000 (22:47 +0300)]
Implement HasModule for AdtId
bors[bot] [Sun, 24 Nov 2019 19:45:08 +0000 (19:45 +0000)]
Merge #2393
2393: Simplify ADT fields r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 24 Nov 2019 19:44:24 +0000 (22:44 +0300)]
Simplify ADT fields