Commit graph

733 commits

Author SHA1 Message Date
Aleksey Kladov
ed943adb29 re-enable chalk 2019-05-21 20:57:36 +03:00
Aleksey Kladov
26463f189f publish gen_lsp_server 0.2 2019-05-21 18:57:33 +03:00
Aleksey Kladov
f63be06002 profile type inference 2019-05-21 16:26:13 +03:00
Aleksey Kladov
0f3e85002b profile implements query 2019-05-21 16:04:17 +03:00
Aleksey Kladov
908c9589a8 fix odrer-of-iteration bug in tests 2019-05-21 14:51:52 +03:00
Aleksey Kladov
0efb5364c3 sort hash maps for tests 2019-05-21 14:14:31 +03:00
bors[bot]
c59a3cdb03 Merge #1296
1296: ⬆️ insta r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-05-21 10:28:55 +00:00
Aleksey Kladov
507c97a18c ⬆️ insta 2019-05-21 13:21:54 +03:00
Aleksey Kladov
69341a0bbe add _query to query functions 2019-05-21 12:44:08 +03:00
Aleksey Kladov
4ca8331933 remove minor code duplication 2019-05-21 01:02:29 +03:00
Aleksey Kladov
9680ae865e simplify 2019-05-20 23:01:49 +03:00
Edwin Cheng
3fc344b9f1 Use normal iteration instead of walk_mut 2019-05-20 17:48:58 +08:00
Edwin Cheng
d4dc879415 Add infer for generic default type 2019-05-19 21:08:16 +08:00
Edwin Cheng
e74d8f148b Add default type to GenericParam 2019-05-19 17:44:29 +08:00
Aleksey Kladov
caa8663c08 allow expanding expressions 2019-05-14 09:03:43 +03:00
Aleksey Kladov
16c7405262 expand to syntax node 2019-05-14 09:03:43 +03:00
Aleksey Kladov
101b3abfd7 store macro kind in HirFileId 2019-05-14 09:03:43 +03:00
bors[bot]
bebc5c7166 Merge #1271
1271: make AstId untyped r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-05-13 21:04:04 +00:00
Florian Diebold
c29a692137 Increase Chalk solver max_size back to 4
Reducing it to 2 was just a failed attempt to see whether that would help fix
some slow cases; in fact, it can create new slow cases by replacing concrete
types by variables.
2019-05-13 22:20:39 +02:00
Aleksey Kladov
549728bba8 make AstId untyped 2019-05-13 19:39:06 +03:00
Aleksey Kladov
9cba67b2ad simplify 2019-05-12 23:03:37 +03:00
Aleksey Kladov
98531dc785 simplify 2019-05-12 22:51:03 +03:00
Florian Diebold
bc59f83991 Use traits from prelude for method resolution 2019-05-12 20:25:26 +02:00
Florian Diebold
7fda874dd4 Blacklist some traits from being considered in where clauses
For Send/Sync/Sized, we don't handle auto traits correctly yet and because they
have a lot of impls, they can easily lead to slowdowns. In the case of
Fn/FnMut/FnOnce, we don't parse the special Fn notation correctly yet and don't
handle closures yet, so we are very unlikely to find an impl.
2019-05-12 20:23:57 +02:00
Florian Diebold
c8b85891b0 Fix impl blocks with unresolved target trait being treated as inherent impls 2019-05-12 20:21:45 +02:00
Florian Diebold
cbe75676b9 Add support for inline bounds
E.g. impl<T: Clone> Foo for T.
2019-05-11 16:56:36 +02:00
Florian Diebold
d6dc75f9f2 Handle auto traits & negative impls
We don't pass field types to Chalk yet though, so the auto trait inference won't
be correct.
2019-05-11 16:21:20 +02:00
Florian Diebold
7744cd41e2 Reduce Chalk max_size parameter, add test for slow case 2019-05-11 16:21:20 +02:00
Florian Diebold
d8cd0e36f5 Handle Chalk conversion for FnDef 2019-05-11 16:21:20 +02:00
Florian Diebold
58b68966bf Handle resolution errors in where clauses
This is slightly hacky, but maybe more elegant than alternative solutions: We
just use a hardcoded Chalk trait ID which we special-case to have no impls.
2019-05-11 16:21:20 +02:00
Florian Diebold
50bbf9eb09 Handle where clauses in trait solving 2019-05-11 16:21:20 +02:00
Florian Diebold
530b3047ed Deduplicate impls in impls_for_trait
This was duplicating impls in dependencies a lot...
2019-05-07 13:45:29 +02:00
Florian Diebold
4083caa233 Add a HirDisplay implementation for TraitRef 2019-05-07 13:45:29 +02:00
Florian Diebold
a78228a39c Turn implements into a query again 2019-05-07 13:45:29 +02:00
Sergey Parilin
26ed925685 fill struct fields diagnostic 2019-05-06 17:16:11 +03:00
bors[bot]
aa7bdfd37f Merge #1208
1208: [WIP] Goto for Macro's r=matklad a=Lapz

Adds goto definition for macros. Currently only works for macros in the current crate ~~otherwise it panics~~. Proper macro resolution needs to be added for it to resolve macros in other crates.

Todo
- [X] Allow goto from macro calls
- [X] Fix panics
- [x] Add tests



![Screen Recording 2019-04-25 at 18 00 24](https://user-images.githubusercontent.com/19998186/56754499-1dd01c00-6785-11e9-9e9a-1e36de70cfa3.gif)



Co-authored-by: Lenard Pratt <l3np27@gmail.com>
2019-05-04 18:38:10 +00:00
Florian Diebold
a4eb1a546c Differentiate Tuple / FnPtr type constructors by cardinality
This is necessary because Chalk (reasonably) expects each 'struct' to know how
many type parameters it takes.
2019-05-04 19:11:21 +02:00
Florian Diebold
19fbd91998 Simplify subst / subst_bound_vars a bit 2019-05-04 18:41:48 +02:00
Lenard Pratt
8198e13c26 Added local macro goto 2019-05-04 17:39:51 +01:00
Florian Diebold
f43e69a64e Handle recursive types in canonicalization 2019-05-04 18:25:36 +02:00
Florian Diebold
5795d773db Remove ToChalk implementation for ApplicationTy 2019-05-04 18:18:30 +02:00
Florian Diebold
621864319f Make canonicalization API a bit nicer 2019-05-04 18:18:30 +02:00
Florian Diebold
0bcf47b22b Update Chalk 2019-05-04 18:18:30 +02:00
Florian Diebold
0f34568924 Turn eprintln!s into debug!s 2019-05-04 18:18:30 +02:00
Florian Diebold
7310f3f801 Handle Ty::Unknown in Chalk conversion
Badly, but at least it doesn't crash.
2019-05-04 18:18:30 +02:00
Florian Diebold
0ad7317b24 Canonicalize before doing method resolution 2019-05-04 18:18:30 +02:00
Florian Diebold
ef77d83751 Document the peculiarity of the solver query a bit
Also remove the only remaining mention of chalk outside of the ty::traits
module.
2019-05-04 18:18:30 +02:00
Florian Diebold
c8a643f090 Move Chalk conversion code to its own module 2019-05-04 18:18:30 +02:00
Florian Diebold
99492278ac Implement Deref<Target=[Ty]> for Substs 2019-05-04 18:18:30 +02:00
Florian Diebold
6c3ee834d6 Simplify solution_from_chalk 2019-05-04 18:18:30 +02:00