Commit graph

140 commits

Author SHA1 Message Date
Aleksey Kladov
733383446f move submodule computationt to module_tree 2019-01-06 17:44:50 +03:00
Aleksey Kladov
17b2994b99 fix the test 2019-01-06 17:38:20 +03:00
Aleksey Kladov
5b0267ecf7 fix after rebase 2019-01-06 17:37:18 +03:00
Aleksey Kladov
fd4456d0ec flatten module structure 2019-01-06 17:36:10 +03:00
Aleksey Kladov
5a505189a8 adjust comments 2019-01-06 17:35:57 +03:00
Aleksey Kladov
a7f4f7bfcc split module source into decl/defin 2019-01-06 17:35:57 +03:00
Aleksey Kladov
9cb02fd931 kill old module 2019-01-06 17:35:57 +03:00
Aleksey Kladov
3c2cb89087 add parent & resolve_path 2019-01-06 17:35:29 +03:00
Aleksey Kladov
1836f4db35 make source cancelable 2019-01-06 17:35:29 +03:00
Aleksey Kladov
b37fba7136 make deps cancelable 2019-01-06 17:35:29 +03:00
Aleksey Kladov
61687b9db6 fix tests 2019-01-06 17:35:29 +03:00
Aleksey Kladov
8c4d277036 switch source-binders to Module 2019-01-06 17:35:29 +03:00
Aleksey Kladov
147b0f94e6 Start code_model::Module 2019-01-06 17:35:29 +03:00
Aleksey Kladov
9a820dc0ee move crate to code_model_api 2019-01-06 17:35:29 +03:00
Florian Diebold
98957f4e6f Add fn signature query 2019-01-06 01:13:31 +01:00
Florian Diebold
e5a6cf8153 Various small code review improvements 2019-01-06 00:38:08 +01:00
Florian Diebold
8e3e5ab2c8 Make FnScopes use hir::Expr
This was a bit complicated. I've added a wrapper type for now that does the
LocalSyntaxPtr <-> ExprId translation; we might want to get rid of that or give
it a nicer interface.
2019-01-06 00:29:36 +01:00
Florian Diebold
136aba1cf3 Add HIR Expr machinery 2019-01-05 22:41:12 +01:00
Florian Diebold
a6f33b4ca5 Add test for invalidation of inferred types when typing inside function
This currently fails, but should work once we have hir::Expr.
2019-01-05 22:41:12 +01:00
bors[bot]
4a3ef8fe63 Merge #370
370: Self params & type r=matklad a=flodiebold

This implements type inference for `self`, so field completion for methods taking `self` works now.

 - rename `IMPL_ITEM` to `IMPL_BLOCK` -- rustc calls the methods etc. inside an impl `ImplItem`s, and the impl itself doesn't define an item, so I thought this name was clearer.
 - add HIR for impl blocks -- we collect all impls in a crate at once, so we can go from methods to containing impls, and since we will later also need to find all impls for a certain type (which may be anywhere in the crate, I think?). We could be more lazy here, but I don't know if it's worth the complexity.
 - resolve `self` and `Self` during type inference
 - refactor a bit in ty.rs as well

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-01-04 19:55:23 +00:00
Aleksey Kladov
6c8e54aaee ⬆️ salsa 2019-01-04 22:31:13 +03:00
Florian Diebold
e6aeabf96f Rename ImplsInCrateQuery as well 2019-01-04 19:52:07 +01:00
Florian Diebold
443ddb73c3 Do impl collection per module, not per crate 2019-01-04 19:29:53 +01:00
Florian Diebold
334ca0d9a7 Rename ImplBlock::target -> target_type, and add target_trait already 2019-01-04 19:16:39 +01:00
Florian Diebold
6ab0e292d2 Refactor a bit 2019-01-04 19:14:22 +01:00
Florian Diebold
538147bf94 Resolve the Self type 2019-01-04 19:13:50 +01:00
Florian Diebold
d4db61b9a1 Resolve the self parameter during type inference 2019-01-04 19:12:29 +01:00
Florian Diebold
111126ed3c Type the self parameter 2019-01-04 19:10:50 +01:00
Florian Diebold
ae9530addc Add HIR for impl blocks
Since we need to be able to go from def to containing impl block, as well as the
other direction, and to find all impls for a certain type, a design similar to
the one for modules, where we collect all impls for the whole crate and keep
them in an arena, seemed fitting. The ImplBlock type, which provides the public
interface, then consists only of an Arc to the arena containing all impls, and
the index into it.
2019-01-04 19:10:47 +01:00
Florian Diebold
226e31dae9 Add test for self type inference 2019-01-04 18:28:43 +01:00
Florian Diebold
fe6c4115f6 Rename ImplItem to ImplBlock
rustc uses the name ImplItem for items in impls, not the impl {} block itself,
which could lead to confusion.
2019-01-04 18:28:36 +01:00
Aleksey Kladov
3fe6f422f9 remove id arena 2019-01-04 16:58:10 +03:00
Aleksey Kladov
d61707b4e1 index stuff produced by macros 2019-01-03 21:29:17 +03:00
Aleksey Kladov
3e764f97eb hardcode vec macro 2019-01-03 14:48:23 +03:00
Aleksey Kladov
28f6eedba5 simplify runnables 2019-01-02 20:12:38 +03:00
Aleksey Kladov
1076e82856 small rename 2019-01-02 16:00:35 +03:00
Aleksey Kladov
35b3fc02e0 comments 2019-01-02 16:00:01 +03:00
Aleksey Kladov
4fe0ec5497 rename 2019-01-02 12:49:47 +03:00
Aleksey Kladov
db8d293208 move macro id to ids 2019-01-02 00:37:36 +03:00
Aleksey Kladov
42cc77703b move more stuff to ids 2019-01-02 00:30:00 +03:00
Aleksey Kladov
37ed2f35ba rename MFileId -> HirFileId 2019-01-02 00:09:54 +03:00
Aleksey Kladov
9c65e61849 introduce ids module 2019-01-01 22:47:10 +03:00
Aleksey Kladov
fca1422ea3 add tests for macro generated items 2019-01-01 22:15:35 +03:00
Aleksey Kladov
756e878158 add items from macros to modules 2019-01-01 22:15:35 +03:00
Aleksey Kladov
4a3f76d3bb wip 2019-01-01 22:15:35 +03:00
Aleksey Kladov
f8d419ee89 fix tests 2019-01-01 22:15:35 +03:00
Aleksey Kladov
289391e163 use MFile 2019-01-01 22:15:35 +03:00
Aleksey Kladov
4161466918 introduce MFileId 2019-01-01 22:15:35 +03:00
Aleksey Kladov
9d4af40995 work towards brining macros to nameres 2019-01-01 22:15:35 +03:00
Aleksey Kladov
7dc45745a3 save top-level macros in module items 2019-01-01 22:15:35 +03:00