Commit Graph

16315 Commits

Author SHA1 Message Date
Florian Diebold
b15152c430 Add TyBuilder 2021-04-04 13:16:38 +02:00
Aleksey Kladov
d1474ae518 Check if bitflags deps pulls its weight
Bitflags is generally a good dependency -- it's lightweight, well
maintained and embraced by the ecosystem.

I wonder, however, do we really need it? Doesn't feel like it adds much
to be honest.
2021-04-04 12:06:01 +03:00
bors[bot]
c9bcbf9a43
Merge #8324
8324: Add `Body::shrink_to_fit` r=jonas-schievink a=jonas-schievink

Saves ~15 MB

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-04 01:27:14 +00:00
Jonas Schievink
1da6d0bed9 Add Body::shrink_to_fit 2021-04-04 03:26:16 +02:00
bors[bot]
3ea5ea1324
Merge #8323
8323: Only remember blocks that have a DefMap r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-04 01:18:13 +00:00
Jonas Schievink
9b13e1bb91 Only remember blocks that have a DefMap 2021-04-04 03:16:26 +02:00
bors[bot]
4c8ee9a531
Merge #8322
8322: Access a body's block def maps via a method r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-04 01:04:44 +00:00
Jonas Schievink
d8bf9bef80 Access a body's block def maps via a method 2021-04-04 03:03:18 +02:00
bors[bot]
6b43a518e6
Merge #8321
8321: Use exhaustive matches in shrink_to_fit impls r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-04 00:56:46 +00:00
Jonas Schievink
f774a56af2 Use exhaustive matches in shrink_to_fit impls 2021-04-04 02:56:11 +02:00
bors[bot]
234ddf34c7
Merge #8320
8320: Make `ast_to_token_tree` infallible r=jonas-schievink a=jonas-schievink

It could never return `None`, so reflect that in the return type

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-03 23:47:10 +00:00
Jonas Schievink
3abcdc03ba Make ast_to_token_tree infallible
It could never return `None`, so reflect that in the return type
2021-04-04 01:46:45 +02:00
bors[bot]
bcf600fc88
Merge #8319
8319: Glob-reexport hir_def database types r=jonas-schievink a=jonas-schievink

Avoids having to constantly adjust this list

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-03 23:30:41 +00:00
Jonas Schievink
613f9ea41e Glob-reexport hir_def database types 2021-04-04 01:29:59 +02:00
bors[bot]
a3dc04905b
Merge #8318
8318: Use shrink_to_fit to reduce DefMap sizes r=jonas-schievink a=jonas-schievink

Especially `block_def_map` can overallocate when there's not a lot of items in the `DefMap`. This saves around 10 MB during analysis-stats. Not too much, but a cheap win.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-03 21:47:39 +00:00
Jonas Schievink
d1bce6070d Use shrink_to_fit to reduce DefMap sizes 2021-04-03 23:45:27 +02:00
bors[bot]
b78f1a0a4d
Merge #8315
8315: Try to reduce ItemTree size further r=jonas-schievink a=jonas-schievink

This was mostly a failed experiment, but still seems like the right thing to do. Memory reduction is mostly negligible.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-03 19:01:03 +00:00
Jonas Schievink
ee4b5a34d8 Use bitflags to compress function properties
Very minor savings, only 1 MB or so
2021-04-03 20:58:42 +02:00
Jonas Schievink
f7e6b186e1 Intern ModPath in Import
Minor savings only
2021-04-03 20:57:25 +02:00
bors[bot]
e2213a503e
Merge #8312
8312: cargo update r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2021-04-03 16:18:44 +00:00
Jeremy Kolb
c7a664c2ea cargo update 2021-04-03 12:18:00 -04:00
Lukas Wirth
df1320d8c4 Rewrite reorder fields assist to use mutable syntax trees 2021-04-03 17:22:16 +02:00
Graeme Coupar
ee03849017 Convert Into to From assist
This adds a "Convert Into to From" assist, useful since clippy has
recently started adding lints on every `Into`.

It covers converting the signature, and converting any `self`/`Self`
references within the body to the correct types.

It does assume that every instance of `Into` can be converted to a
`From`, which I _think_ is the case now.  Let me know if there's
something I'm not thinking of and I can try and make it smarter.
2021-04-03 15:48:35 +01:00
bors[bot]
2f87ee7f3f
Merge #8310
8310: Rename Ty::interned to Ty::kind r=flodiebold a=flodiebold

... since that's the actual method on Chalk side that matches the signature.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-04-03 11:09:43 +00:00
Florian Diebold
c551604b5a Rename Ty::interned to Ty::kind
... since that's the actual method on Chalk side that matches the signature.
2021-04-03 13:08:29 +02:00
bors[bot]
8289b96216
Merge #8309
8309: Introduce `GenericArg` like in Chalk r=flodiebold a=flodiebold

Plus some more adaptations to Substitution.

Lots of `assert_ty_ref` that we should revisit when introducing lifetime/const parameters.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-04-03 09:19:55 +00:00
Florian Diebold
e480d81988 Introduce GenericArg like in Chalk
Plus some more adaptations to Substitution.

Lots of `assert_ty_ref` that we should revisit when introducing
lifetime/const parameters.
2021-04-03 11:17:13 +02:00
bors[bot]
327f3a0a30
Merge #8307
8307: Allow include! an empty content file r=edwin0cheng a=edwin0cheng

fixes #8306

bors r+

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2021-04-03 04:55:39 +00:00
Edwin Cheng
20d55ce44d Allow include! an empty content file 2021-04-03 12:50:55 +08:00
bors[bot]
b5804296dd
Merge #8305
8305: Fix joinLines panic if run on the empty last line r=edwin0cheng a=edwin0cheng

fixes #8299

bors r+

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2021-04-03 03:21:45 +00:00
Edwin Cheng
b636080f67 Fix joinLines panic if run on the empty last line 2021-04-03 11:20:16 +08:00
bors[bot]
bf695c487a
Merge #8304
8304: Support the new `panic!()` macro r=jonas-schievink a=jonas-schievink

Includes a minor fixup to macro 2.0 parsing.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-03 01:14:56 +00:00
Jonas Schievink
5742cdf3f1 Support #[rustc_builtin_macro = "builtin_name"] 2021-04-03 03:13:04 +02:00
Jonas Schievink
6198eb74b2 Implement edition-dependent builtin panic! macro 2021-04-03 03:12:55 +02:00
Jonas Schievink
eaffdae300 Allow , to delimit macro 2.0 rules 2021-04-03 03:08:31 +02:00
bors[bot]
eb264fb819
Merge #8303
8303: Allow interning strings r=jonas-schievink a=jonas-schievink

We don't use it yet, that's a bit more complicated.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-03 00:09:41 +00:00
Jonas Schievink
85757be59a Allow interning strings 2021-04-03 01:00:45 +02:00
bors[bot]
8e3e13f3a4
Merge #8298
8298: Stop using an upgradeable read lock in interning r=jonas-schievink a=jonas-schievink

Only one upgradeable read lock can be handed out at the same time, and
we never acquire a non-upgradeable read lock, so this has no benefit
over just using a write lock in the first place.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-02 18:47:25 +00:00
Jonas Schievink
e73d26fa62 Stop using an upgradeable read lock in interning
Only one upgradeable read lock can be handed out at the same time, and
we never acquire a non-upgradeable read lock, so this has no benefit
over just using a write lock in the first place.
2021-04-02 20:46:37 +02:00
bors[bot]
0129628a0f
Merge #8297
8297: Only populate prelude for crate-level DefMaps r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-02 17:00:57 +00:00
Jonas Schievink
7ceaba21df Only populate prelude for crate-level DefMaps 2021-04-02 19:00:26 +02:00
bors[bot]
f4d56989b6
Merge #8284
8284: Reduce memory usage by using global `Arc`-based interning r=jonas-schievink a=jonas-schievink

This saves around 50 mb when running `analysis-stats` on r-a itself. Not a lot, but this infra can be easily reused to intern more stuff.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-02 16:43:16 +00:00
bors[bot]
9bcdbefc7b
Merge #8291
8291: Put the revision in the startup message r=jonas-schievink a=lf-



Co-authored-by: Jade <software@lfcode.ca>
2021-04-02 16:35:22 +00:00
Jonas Schievink
6e227b80a7 Remove ?Sized on PartialEq/Eq impls 2021-04-02 18:26:34 +02:00
Jonas Schievink
76452956e4 Split Intern::drop into hot and cold path 2021-04-02 18:11:08 +02:00
bors[bot]
d619070b83
Merge #8287
8287: Don't allocate in `associated_type_shorthand_candidates` r=Veykril a=Veykril



Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-04-02 14:41:24 +00:00
Lukas Wirth
c24753ae5d Don't allocate in associated_type_shorthand_candidates 2021-04-02 16:40:31 +02:00
bors[bot]
2c5f905c67
Merge #8294
8294: minor: add profile call for resolve_obligations r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-02 12:30:02 +00:00
Aleksey Kladov
387d7c7d96 minor: add profile call for resolve_obligations 2021-04-02 15:28:51 +03:00
bors[bot]
71ef64b673
Merge #8293
8293: internal: document style for helper functions and variables r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-02 12:00:30 +00:00