Commit graph

236 commits

Author SHA1 Message Date
Marcus Klaas de Vries
a2b6d3da30 Implement rudimentary type inference for unary operators 2019-01-16 00:04:39 +01:00
Aleksey Kladov
02c3d2f78e hir is cancelation free 2019-01-15 20:56:06 +03:00
Aleksey Kladov
8ba9c2d4ce remove Cancelable from type inference 2019-01-15 20:54:18 +03:00
Aleksey Kladov
b871062e32 remove Cancelable from Ty 2019-01-15 20:43:37 +03:00
Aleksey Kladov
fafcd103d2 remove Cancelable from ids 2019-01-15 19:18:52 +03:00
Aleksey Kladov
490112dea1 remove Cancelable from nameres 2019-01-15 19:15:01 +03:00
Aleksey Kladov
18e9a710cd remove Cancelable from fn_scopes 2019-01-15 19:04:49 +03:00
Aleksey Kladov
040a622c52 remove Cancelable from funciton body 2019-01-15 19:01:59 +03:00
Aleksey Kladov
f1367e0370 remove Cancelable from navigation target 2019-01-15 18:50:16 +03:00
Aleksey Kladov
9dd4099d93 remove Cancelable from static&const API 2019-01-15 18:45:01 +03:00
Aleksey Kladov
9446be2999 remove Cancelable from adt API 2019-01-15 18:43:25 +03:00
Aleksey Kladov
8af9a18660 remove Cancelable from Crate API 2019-01-15 18:33:26 +03:00
Aleksey Kladov
c159e414b4 remove Cancelable from Module API, part 2 2019-01-15 18:30:58 +03:00
Aleksey Kladov
ca52cf1ecd remove Cancelable from Module API 2019-01-15 18:26:29 +03:00
Aleksey Kladov
11f3c8afb2 remove Cancelable from source binders 2019-01-15 18:13:49 +03:00
Aleksey Kladov
68ff52566d remove Cancelable from module_tree_query 2019-01-15 17:55:15 +03:00
Aleksey Kladov
fedd320cf2 check_canceled does not return Result 2019-01-15 15:45:48 +03:00
Aleksey Kladov
dd45697e53 update salsa 2019-01-15 15:06:45 +03:00
Marcus Klaas de Vries
37ba237e66 Address issues found in review 2019-01-14 21:52:08 +01:00
Marcus Klaas de Vries
d67eabb512 Fix type inference for raw (byte) strings 2019-01-14 20:56:14 +01:00
Marcus Klaas de Vries
2689348772 Give literal expression default values for now 2019-01-14 19:46:10 +01:00
Marcus Klaas de Vries
a9a6a50c75 Fixup tests 2019-01-14 19:30:21 +01:00
Marcus Klaas de Vries
606d66a714 Start moving literal interpretation to the AST (WIP) 2019-01-14 13:56:43 +01:00
Marcus Klaas de Vries
81bc8e4973 don't try to treat arrays and tuples as literals 2019-01-14 13:55:49 +01:00
Marcus Klaas de Vries
1574715be5 Use type variables to determine exact type for ambiguous numeric literals 2019-01-14 13:54:31 +01:00
Marcus Klaas de Vries
5f5dc20d85 Try implementing integer type inference (WIP) 2019-01-14 13:52:57 +01:00
Marcus Klaas de Vries
a6146d35b1 Implement type inference for literals (WIP) 2019-01-14 13:52:55 +01:00
Aleksey Kladov
eedc08300c goto defenition works for type-inferred methods 2019-01-13 18:56:57 +03:00
Hirokazu Hata
139da0841d Fix tuple test case 2019-01-13 22:23:06 +09:00
Hirokazu Hata
6e73cc89b6 Implement tuple inference 2019-01-13 21:10:01 +09:00
Hirokazu Hata
829f668bd7 Add infer tuple test 2019-01-13 21:04:03 +09:00
bors[bot]
0199572a3d Merge #517 #518
517: gracefully handle cycles in crate graph r=matklad a=matklad



518: Add an explanatory message when we use the Query fallback r=matklad a=DJMcNab

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

There is no good way to explain it for go_to_def, so I've just fallen back on to_vec.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Co-authored-by: DJMcNab <36049421+djmcnab@users.noreply.github.com>
2019-01-13 10:41:47 +00:00
Aleksey Kladov
77f67ca7e2 gracefully handle cycles in crate graph
rust-lang/rust has absolutely weird setup with rustc-workspace-shim,
which leads to real cycles.
2019-01-13 13:39:48 +03:00
Aleksey Kladov
8e554ea5fa support ref-patterns 2019-01-13 13:36:06 +03:00
Florian Diebold
1ed7fbfc1b args -> params 2019-01-12 21:58:16 +01:00
Florian Diebold
5db5f5cc1d Small improvements from review comments 2019-01-12 21:51:56 +01:00
Florian Diebold
082ef52bcb Implement basic inherent method resolution 2019-01-12 15:01:19 +01:00
Florian Diebold
1212e59bee Fix assertion error in unification (hopefully)
Currently, all types that we handle during inference need to be resolved as far
as possible at the time. It's maybe too brittle of an invariant; I need to think
how we can do this better. This should fix #484 though, I hope (if
it's the same case as I managed to reproduce).
2019-01-11 22:59:00 +01:00
Aleksey Kladov
f193fbcbae actually produce missing def kinds 2019-01-11 21:02:12 +03:00
Aleksey Kladov
19136cde00 uncopypaste def sources 2019-01-11 20:43:10 +03:00
Aleksey Kladov
0f9c350812 add missing def kinds 2019-01-11 20:28:10 +03:00
Aleksey Kladov
2d3940d0ab rename TreePtr -> TreeArc
This is much clearer about the semantics
2019-01-11 19:59:06 +03:00
Aleksey Kladov
f9ed8d4d23 envapsulate navigation target better 2019-01-11 16:01:57 +03:00
Florian Diebold
a6590ce231 Use name resolution for goto definition 2019-01-10 21:32:54 +01:00
bors[bot]
dc2a8d5acc Merge #470
470: Type inference for enum variants r=flodiebold a=marcusklaas

Opened a new PR instead of https://github.com/rust-analyzer/rust-analyzer/pull/461. Totally botched that one.

I think I resolved all the issues mentioned there.

Co-authored-by: Marcus Klaas de Vries <mail@marcusklaas.nl>
2019-01-10 19:12:40 +00:00
Aleksey Kladov
32fa084c07 introduce marking infrastructure for maintainable tests
This also fixes a particular edge case in name resolution.
2019-01-10 16:45:09 +03:00
Marcus Klaas de Vries
e78286c8e8 Save variant names in EnumData to reduce needless queries
We already have their names when anyway, and when in all (current)
situations where we're interested in an Enum's variants, we want
their names.
2019-01-10 14:43:01 +01:00
Marcus Klaas de Vries
978de5cf8b Implement type inference for enum variants 2019-01-10 14:32:56 +01:00
bors[bot]
aca14c591f Merge #475
475: Show types of fields in completion r=matklad a=matklad

![image](https://user-images.githubusercontent.com/1711539/50910524-0f146200-143f-11e9-84d6-0ba80761cd89.png)

r? @flodiebold 


Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-01-10 13:07:19 +00:00
Aleksey Kladov
f72c031eb9 implement RefUnwindSafe 2019-01-10 13:04:04 +03:00