Commit graph

9136 commits

Author SHA1 Message Date
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
Edwin Cheng
73e512215a Fix non canonicallized path for crate file 2020-04-11 18:12:50 +08: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
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
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
Aleksey Kladov
30084a56a5 Simpler acessors for keywords 2020-04-09 23:42:01 +02:00
Aleksey Kladov
00ec0c1066 use uniform accessor 2020-04-09 23:19:51 +02:00
Aleksey Kladov
046a021013 use stdx 2020-04-09 23:05:13 +02:00
Aleksey Kladov
0ed27c388a Drop needless trait 2020-04-09 23:02:10 +02:00
bors[bot]
eb07803e81
Merge #3922
3922: Remove code duplication r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-09 20:23:27 +00:00
Aleksey Kladov
e07d3c94de Remove code duplication 2020-04-09 22:22:58 +02:00
bors[bot]
33df20868d
Merge #3918
3918: Add support for feature attributes in struct literal r=matklad a=bnjjj

As promised here is the next PR to solve 2 different scenarios with feature flag on struct literal.
close #3870 

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-09 19:27:06 +00:00
bors[bot]
9635d8bc44
Merge #3901
3901: Add more heuristics for hiding obvious param hints r=matklad a=IceSentry

This will now hide `value`, `pat`, `rhs` and `other`. These words were selected from the std because they are used in commonly used functions with only a single param and are obvious by their use.

It will also hide the hint if the passed param **starts** or end with the param_name. Maybe we could also split on '_' and check if one of the string is the param_name.

I think it would be good to also hide `bytes` if the type is `[u8; n]` but I'm not sure how to get the param type signature.

Closes #3900 



Co-authored-by: IceSentry <c.giguere42@gmail.com>
2020-04-09 18:07:28 +00:00
Benjamin Coenen
c1317d6923 feat: add support for feature attributes in struct literal
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-09 19:12:50 +02:00
bors[bot]
dde9488559
Merge #3919
3919: Refactor tokena accessors r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-04-09 16:54:14 +00:00
Aleksey Kladov
2bfb65db93 Be consistent about token accesors 2020-04-09 18:48:13 +02:00
bors[bot]
4cea01fdf8
Merge #3917
3917: Improve tt::Subtree debug print r=matklad a=edwin0cheng



Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-04-09 16:39:19 +00:00
Benjamin Coenen
fc70cf9458 feat: add support for feature attributes in struct literal
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-09 18:32:02 +02:00
IceSentry
ebc61709c8 use .expr() to remove ref 2020-04-09 12:26:49 -04:00
Aleksey Kladov
e6d22187a6 Add _token suffix to token accessors
I think this makes is more clear which things are : AstNode and which
are : AstToken
2020-04-09 18:25:36 +02:00
Aleksey Kladov
a95116fbfa Simplify 2020-04-09 18:20:06 +02:00
Edwin Cheng
19d952c603 Improve tt::Subtree debug print 2020-04-10 00:17:32 +08:00