Commit graph

9559 commits

Author SHA1 Message Date
Josh Mcguigan
aec20e5094 missing match arm add test for partially diverging type 2020-04-11 07:13:47 -07:00
Josh Mcguigan
26e5bb0a4e missing match arms add tests for match expression diverging 2020-04-11 07:07:47 -07:00
Aleksey Kladov
997c959d4f
Merge pull request #3935 from cjhopman/todo
Change missing impl assist to use todo!() instead of unimplemented()
2020-04-11 16:05:23 +02:00
bors[bot]
372414d27b
Merge #3942
3942: vscode: fix typing bug in config r=matklad a=Veetaha

I noticed that the type of nullable properties in config is actually non-nullable
![Screenshot from 2020-04-11 15-29-45](https://user-images.githubusercontent.com/36276403/79043702-6a686d80-7c09-11ea-9ae8-f1a777c7d0f2.png)


Co-authored-by: veetaha <veetaha2@gmail.com>
2020-04-11 13:26:17 +00:00
bors[bot]
0679d8cbe7
Merge #3943
3943: vscode: fix indent r=matklad a=Veetaha



Co-authored-by: veetaha <veetaha2@gmail.com>
2020-04-11 12:49:03 +00:00
Aleksey Kladov
8bd14a3483
Merge pull request #3910 from lnicola/fn-named-param-hint
Hide parameter hints for single-argument functions with the same name
2020-04-11 14:48:14 +02:00
Aleksey Kladov
82c98f425c
Merge pull request #3940 from lnicola/cargo-audit
Use actions-rs/install and /audit-check for cargo-audit
2020-04-11 14:46:20 +02:00
veetaha
12e23bd60b vscode: fix typing bug in config 2020-04-11 15:40:49 +03:00
veetaha
f778242a37 vscode: fix indent 2020-04-11 15:37:06 +03:00
bors[bot]
0ecdba20df
Merge #3920
3920: Implement expand_task and list_macros in proc_macro_srv r=matklad a=edwin0cheng

This PR finish up the remain `proc_macro_srv` implementation :

1. Added dylib loading code for proc-macro crate dylib. Note that we have to add some special flags for unix loading because of a bug in old version of glibc, see https://github.com/fedochet/rust-proc-macro-panic-inside-panic-expample/issues/1 and https://github.com/rust-lang/rust/issues/60593 for details.

2. Added tests for proc-macro expansion: We use a trick here by adding `serde_derive` to dev-dependencies and calling `cargo-metadata` for searching its dylib path, and expand it in our tests. 

[EDIT]
Note that this PR **DO NOT** implement the final glue code with rust-analzyer and proc-macro-srv yet.
 

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-04-11 11:49:07 +00:00
bors[bot]
54bdb9c78b
Merge #3939
3939: Fix non canonicallized path from metadata r=matklad a=edwin0cheng

Crate root path obtained from cargo-metadata may contains non-canonicalized path (e.g. `/foo/../libcore/tests/lib.rs`), such that `vfs::load` will find a incorrect root. 

This PR try to fix that by canonicalize it before passing to vfs.

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-04-11 11:41:40 +00:00
Laurențiu Nicola
ebf77c2bf7 Use actions-rs/install and /audit-check for cargo-audit 2020-04-11 14:32:53 +03:00
Geoffrey Copin
21443f1b48 Remove Option unwraping 2020-04-11 12:58:20 +02:00
Edwin Cheng
73e512215a Fix non canonicallized path for crate file 2020-04-11 18:12:50 +08:00
Edwin Cheng
31d163aa3b Improve error handling 2020-04-11 14:53:13 +08:00
Josh Mcguigan
d1338354ca fix match arm false positive 2020-04-10 20:14:53 -07:00
bors[bot]
beb755caa2
Merge #3937
3937: Forward compat r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-10 22:29:04 +00:00
Aleksey Kladov
c1244c853c Forward compat 2020-04-11 00:27:00 +02:00
Chris Hopman
af04d45d32 Change missing impl assist to use todo!() instead of unimplemented()
todo!() "Indicates unfinished code" (https://doc.rust-lang.org/std/macro.todo.html)

Rust documentation provides further clarification:

> The difference between unimplemented! and todo! is that while todo!
> conveys an intent of implementing the functionality later and the
> message is "not yet implemented", unimplemented! makes no such claims.

todo!() seems more appropriate for assists that insert missing impls.
2020-04-10 13:56:12 -07:00
bors[bot]
ca9a5dd165
Merge #3933
3933: Fix accidently quadratic behavior when processing include! r=matklad a=matklad

This fixes the immediate problem behind #3927. It doesn't yet fix the deeper problem with `to_node` being quadratic (hence the test is ignored), but it is a good start anyway.

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-10 19:16:32 +00:00
Aleksey Kladov
1b68c72fe9 Move timeit to stdx 2020-04-10 20:46:42 +02:00
bors[bot]
773bb5173d
Merge #3931
3931: profile queries r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-10 18:27:12 +00:00
Aleksey Kladov
7995c916fe profile queries 2020-04-10 20:26:47 +02:00
Aleksey Kladov
72a0db8dc4 profile queries 2020-04-10 20:25:55 +02:00
bors[bot]
348c586bff
Merge #3930
3930: cargo update r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-04-10 17:49:33 +00:00
kjeremy
51b1750cfa cargo update 2020-04-10 13:48:25 -04:00
Aleksey Kladov
428d4dfe71 Fix accidently quadratic behavior when processing includes
closes #3927
2020-04-10 19:43:37 +02:00
Aleksey Kladov
5e2f29af85 Add failing test 2020-04-10 19:43:37 +02:00
bors[bot]
f553162c4e
Merge #3928
3928: Simplify r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-10 15:48:21 +00:00
Aleksey Kladov
c476742f47 Simplify 2020-04-10 17:47:49 +02:00
bors[bot]
fcd609862b
Merge #3926
3926: Rename some tokens r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-10 15:07:36 +00:00
Aleksey Kladov
5c5bde47fb Rename some tokens 2020-04-10 17:07:09 +02:00
Aleksey Kladov
d4332760d8 Better readability 2020-04-10 16:10:28 +02:00
Aleksey Kladov
e0f02d233f Remove dead code 2020-04-10 16:10:28 +02:00
Aleksey Kladov
4560fe2abf Generate only minimal set of ineresting tokens 2020-04-10 16:10:28 +02:00
Aleksey Kladov
8d71a6bf0c Scale token generation back 2020-04-10 16:10:28 +02:00
Aleksey Kladov
779f06ed77 Convert more tokens 2020-04-10 16:10:28 +02:00
Aleksey Kladov
548f562dda Other delimiters 2020-04-10 16:10:28 +02:00
Aleksey Kladov
460c8bbdec Curley tokens 2020-04-10 16:10:28 +02:00
Aleksey Kladov
1c5d859195 Start replacing tokens 2020-04-10 16:10:28 +02:00
Aleksey Kladov
c8b4c36f81 Semicolon token 2020-04-10 16:10:28 +02:00
Aleksey Kladov
f89f2e3885 More readable ast_src for keywords 2020-04-10 16:10:28 +02:00
Aleksey Kladov
ff5643c524 Simplify 2020-04-10 16:10:27 +02:00
bors[bot]
38e0d0f334
Merge #3905
3905: add ellipsis field to hir pat record r=matklad a=JoshMcguigan

This PR corrects a `fixme`, adding an `ellipsis` field to the hir `Pat::Record` type. It will also be unlock some useful follow on work for #3894.

Additionally it adds a diagnostic for missing fields in record patterns.

~~Marking as a draft because I don't have any tests, and a small amount of manual testing on my branch from #3894 suggests it might *not* be working. Any thoughts on how I can best test this, or else pointers on where I might be going wrong?~~

Co-authored-by: Josh Mcguigan <joshmcg88@gmail.com>
2020-04-10 13:52:25 +00:00
Josh Mcguigan
e63315b8f1 add record pat missing field diagnostic 2020-04-10 06:35:52 -07:00
bors[bot]
0a891d19ae
Merge #3748
3748: Implement Chalk's debug methods using TLS r=matklad a=flodiebold

Chalk now panics if we don't implement these methods and run with CHALK_DEBUG, so I thought I'd try to implement them 'properly'. Sadly, it seems impossible to do without transmuting lifetimes somewhere. The problem is that we need a `&dyn HirDatabase` to get names etc., which we can't just put into TLS. I thought I could just use `scoped-tls`, but that doesn't support references to unsized types. So I put the `&dyn` into another struct and put the reference to *that* into the TLS, but I have to transmute the lifetime to 'static for that to work. I think this is sound, but I still don't really want to do it this way...

Having names in the Chalk debug output is very nice, but maybe IDs will have to suffice 😞 

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-04-10 13:25:24 +00:00
Florian Diebold
a0a80a4103 Implement Chalk's debug methods using TLS
Chalk now panics if we don't implement these methods and run with CHALK_DEBUG,
so I thought I'd try to implement them 'properly'. Sadly, it seems impossible to
do without transmuting lifetimes somewhere. The problem is that we need a `&dyn
HirDatabase` to get names etc., which we can't just put into TLS. I thought I
could just use `scoped-tls`, but that doesn't support references to unsized
types. So I put the `&dyn` into another struct and put the reference to *that*
into the TLS, but I have to transmute the lifetime to 'static for that to work.
2020-04-10 15:04:06 +02:00
Edwin Cheng
5fc8f90a21 tidy up a bit 2020-04-10 19:08:15 +08:00
Geoffrey Copin
730a927c5e Implement assist "Reorder field names" 2020-04-10 00:57:03 +02:00
bors[bot]
176f7f6117
Merge #3923
3923: Cleanup keyword accessors r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-09 21:47:34 +00:00