]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agopin cache action
Arpad Borsos [Thu, 8 Apr 2021 18:44:44 +0000 (20:44 +0200)]
pin cache action

3 years agonoop to test CI cache
Arpad Borsos [Thu, 8 Apr 2021 17:13:21 +0000 (19:13 +0200)]
noop to test CI cache

3 years agoMove CI to rust-cache Action
Arpad Borsos [Thu, 8 Apr 2021 16:55:28 +0000 (18:55 +0200)]
Move CI to rust-cache Action

3 years agoMerge #8421
bors[bot] [Thu, 8 Apr 2021 15:43:30 +0000 (15:43 +0000)]
Merge #8421

8421: Reduce allocations in "Expand macro" formatter r=edwin0cheng a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoMerge #8419 #8423
bors[bot] [Thu, 8 Apr 2021 15:00:53 +0000 (15:00 +0000)]
Merge #8419 #8423

8419: Move hir_ty to Chalk IR r=flodiebold a=flodiebold

Closes #8313.

There's some further cleanups to do:
 - we're still using our `TypeWalk` in lots of places (not for mutating/folding though, just for walking)
 - we're still using our own canonicalization and unification and our `InferenceTable`
 - ~`ToChalk` still exists and gets called, it's just the identity in most cases now (I'll probably clean those up before merging this)~

8423: Bump lsp-types and syn r=kjeremy a=kjeremy

This lsp-types now supports a default InsertTextMode for completion and a per-completion item commit_characters

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agoBump lsp-types and syn
kjeremy [Thu, 8 Apr 2021 14:57:47 +0000 (10:57 -0400)]
Bump lsp-types and syn

This lsp-types now supports a default InsertTextMode for completion and a per-completion item commit_characters

3 years agoMerge #8422
bors[bot] [Thu, 8 Apr 2021 14:51:51 +0000 (14:51 +0000)]
Merge #8422

8422: Remove extra bracket in architecture docs r=lnicola a=lnicola

bors r+

changelog skip

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoRemove extra bracket in architecture docs
Laurențiu Nicola [Thu, 8 Apr 2021 14:51:02 +0000 (17:51 +0300)]
Remove extra bracket in architecture docs

3 years agoReduce allocations in Expand macro
Laurențiu Nicola [Thu, 8 Apr 2021 14:20:14 +0000 (17:20 +0300)]
Reduce allocations in Expand macro

3 years agoRemove unused
Florian Diebold [Thu, 8 Apr 2021 12:35:15 +0000 (14:35 +0200)]
Remove unused

3 years agoReplace `make_binders` by the now equivalent `make_only_type_binders`
Florian Diebold [Thu, 8 Apr 2021 12:21:22 +0000 (14:21 +0200)]
Replace `make_binders` by the now equivalent `make_only_type_binders`

3 years agoRemove identity impls for ToChalk
Florian Diebold [Thu, 8 Apr 2021 12:16:05 +0000 (14:16 +0200)]
Remove identity impls for ToChalk

3 years agoFix `Canonicalized::apply_solution`
Florian Diebold [Thu, 8 Apr 2021 11:58:03 +0000 (13:58 +0200)]
Fix `Canonicalized::apply_solution`

Now that we're using Chalk's `substitute` which actually knows about
lifetimes, the hack doesn't work anymore, but we can put in a proper
lifetime.

3 years agoFix missing match arms
Florian Diebold [Thu, 8 Apr 2021 11:51:04 +0000 (13:51 +0200)]
Fix missing match arms

3 years agoFix remaining `interned_mut` call
Florian Diebold [Thu, 8 Apr 2021 11:32:56 +0000 (13:32 +0200)]
Fix remaining `interned_mut` call

3 years agoReplace remaining `fold` calls
Florian Diebold [Thu, 8 Apr 2021 11:32:48 +0000 (13:32 +0200)]
Replace remaining `fold` calls

3 years agoReplace some `fold` calls
Florian Diebold [Wed, 7 Apr 2021 19:26:37 +0000 (21:26 +0200)]
Replace some `fold` calls

3 years agoFix shifted_{in,out} calls
Florian Diebold [Wed, 7 Apr 2021 19:26:24 +0000 (21:26 +0200)]
Fix shifted_{in,out} calls

3 years agoFix subst_prefix
Florian Diebold [Wed, 7 Apr 2021 19:17:51 +0000 (21:17 +0200)]
Fix subst_prefix

3 years agoGet rid of walk_mut [not compiling]
Florian Diebold [Wed, 7 Apr 2021 19:16:18 +0000 (21:16 +0200)]
Get rid of walk_mut [not compiling]

3 years agoFix TyBuilder methods
Florian Diebold [Wed, 7 Apr 2021 19:12:42 +0000 (21:12 +0200)]
Fix TyBuilder methods

3 years agoImpl Fold for CallableSig
Florian Diebold [Wed, 7 Apr 2021 19:10:28 +0000 (21:10 +0200)]
Impl Fold for CallableSig

3 years agoAdd HasInterner bounds
Florian Diebold [Sat, 3 Apr 2021 15:49:29 +0000 (17:49 +0200)]
Add HasInterner bounds

3 years agoAllow unused
Florian Diebold [Sat, 3 Apr 2021 15:42:13 +0000 (17:42 +0200)]
Allow unused

3 years agoRemove obsolete Cast impls
Florian Diebold [Sat, 3 Apr 2021 15:41:55 +0000 (17:41 +0200)]
Remove obsolete Cast impls

3 years agoMake ToChalk implementations identity
Florian Diebold [Sat, 3 Apr 2021 15:41:14 +0000 (17:41 +0200)]
Make ToChalk implementations identity

3 years agoReplace all the types by their Chalk versions
Florian Diebold [Sat, 3 Apr 2021 15:40:56 +0000 (17:40 +0200)]
Replace all the types by their Chalk versions

3 years agoMerge #8207
bors[bot] [Thu, 8 Apr 2021 05:46:15 +0000 (05:46 +0000)]
Merge #8207

8207: Show dbg remove assist on empty contents r=edwin0cheng a=ivan770

Closes #8185

Co-authored-by: ivan770 <leshenko.ivan770@gmail.com>
Co-authored-by: ivan770 <ivan@ivan770.me>
3 years agoMerge #8412
bors[bot] [Wed, 7 Apr 2021 22:12:43 +0000 (22:12 +0000)]
Merge #8412

8412: Emit folding ranges for multiline array literals r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoEmit folding ranges for multiline array literals
Lukas Wirth [Wed, 7 Apr 2021 22:05:08 +0000 (00:05 +0200)]
Emit folding ranges for  multiline array literals

3 years agoMerge #8409
bors[bot] [Wed, 7 Apr 2021 18:51:36 +0000 (18:51 +0000)]
Merge #8409

8409: Various remaining fixes for Chalk IR move r=flodiebold a=flodiebold

CC #8313

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoFix return type of Substitution::interned
Florian Diebold [Wed, 7 Apr 2021 18:50:26 +0000 (20:50 +0200)]
Fix return type of Substitution::interned

3 years agoInEnvironment::new takes a reference
Florian Diebold [Wed, 7 Apr 2021 18:48:58 +0000 (20:48 +0200)]
InEnvironment::new takes a reference

3 years agoMake Canonical::new a free-standing function
Florian Diebold [Wed, 7 Apr 2021 18:47:04 +0000 (20:47 +0200)]
Make Canonical::new a free-standing function

3 years agoFix return type of `self_type_parameter`
Florian Diebold [Wed, 7 Apr 2021 18:41:52 +0000 (20:41 +0200)]
Fix return type of `self_type_parameter`

3 years agoMove hir_trait_id to extension trait
Florian Diebold [Wed, 7 Apr 2021 18:40:01 +0000 (20:40 +0200)]
Move hir_trait_id to extension trait

3 years agoChange TraitRef::hir_fmt_ext to free-standing function
Florian Diebold [Wed, 7 Apr 2021 18:26:27 +0000 (20:26 +0200)]
Change TraitRef::hir_fmt_ext to free-standing function

3 years agoMerge #8408
bors[bot] [Wed, 7 Apr 2021 18:27:03 +0000 (18:27 +0000)]
Merge #8408

8408: Update `OUT_DIR` diagnostic to match setting r=jonas-schievink a=jonas-schievink

The setting was renamed, so the diagnostic should follow

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoUpdate `OUT_DIR` diagnostic to match setting
Jonas Schievink [Wed, 7 Apr 2021 18:19:28 +0000 (20:19 +0200)]
Update `OUT_DIR` diagnostic to match setting

3 years agoMerge #8388
bors[bot] [Wed, 7 Apr 2021 18:17:38 +0000 (18:17 +0000)]
Merge #8388

8388: Autoclose blocks when typing `{` r=jonas-schievink a=jonas-schievink

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoMerge #8407
bors[bot] [Wed, 7 Apr 2021 18:10:39 +0000 (18:10 +0000)]
Merge #8407

8407: Move `equals_ctor` to `TyExt` r=flodiebold a=flodiebold

I'd prefer getting rid of it, but it's used in the impl search and not super easy to replace there (I think ideally the impl search would do proper unification, but that's a bit more complicated).

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoMove `equals_ctor` to `TyExt`
Florian Diebold [Wed, 7 Apr 2021 18:08:50 +0000 (20:08 +0200)]
Move `equals_ctor` to `TyExt`

I'd prefer getting rid of it, but it's used in the impl search and not
super easy to replace there (I think ideally the impl search would do
proper unification, but that's a bit more complicated).

3 years agoMerge #8402
bors[bot] [Wed, 7 Apr 2021 15:58:22 +0000 (15:58 +0000)]
Merge #8402

8402: Remove Ty::substs{_mut} r=flodiebold a=flodiebold

Almost all uses actually only care about ADT substs, so it's better to be explicit. The methods were a bad abstraction anyway since they already didn't include the inner types of e.g. `TyKind::Ref` anymore.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoRemove Ty::substs{_mut}
Florian Diebold [Wed, 7 Apr 2021 15:26:01 +0000 (17:26 +0200)]
Remove Ty::substs{_mut}

Almost all uses actually only care about ADT substs, so it's better to
be explicit. The methods were a bad abstraction anyway since they
already didn't include the inner types of e.g. `TyKind::Ref` anymore.

3 years agoMerge #8401
bors[bot] [Wed, 7 Apr 2021 15:41:25 +0000 (15:41 +0000)]
Merge #8401

8401: Update crates r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agoUpdate crates
kjeremy [Wed, 7 Apr 2021 15:39:33 +0000 (11:39 -0400)]
Update crates

3 years agoDocument `}` insertion
Jonas Schievink [Wed, 7 Apr 2021 15:19:42 +0000 (17:19 +0200)]
Document `}` insertion

3 years agoMake better use of `stdx::always`
Jonas Schievink [Wed, 7 Apr 2021 14:44:25 +0000 (16:44 +0200)]
Make better use of `stdx::always`

3 years agoRewrite, reparse modified file
Jonas Schievink [Wed, 7 Apr 2021 14:37:47 +0000 (16:37 +0200)]
Rewrite, reparse modified file

3 years agosimplify
Jonas Schievink [Tue, 6 Apr 2021 23:39:17 +0000 (01:39 +0200)]
simplify

3 years agoUse stdx::always
Jonas Schievink [Tue, 6 Apr 2021 23:26:22 +0000 (01:26 +0200)]
Use stdx::always

3 years agoComplete braces more aggressively
Jonas Schievink [Tue, 6 Apr 2021 23:24:24 +0000 (01:24 +0200)]
Complete braces more aggressively

3 years agoAutoclose blocks when typing `{`
Jonas Schievink [Tue, 6 Apr 2021 21:55:39 +0000 (23:55 +0200)]
Autoclose blocks when typing `{`

3 years agoMerge #8397
bors[bot] [Wed, 7 Apr 2021 12:37:10 +0000 (12:37 +0000)]
Merge #8397

8397: Return proper error code when server is loading r=matklad a=ceronman

When requests are made to rust-analyzer and the server is still loading, a response error is returned with the code `ContentModified` and text `"Rust Analyzer is still loading..."`. This error code doesn't seem to be the more appropriate for this situation. Using `ServerNotInitialized` seems better.

As this is such a small change, I have not created an issue for it.

Co-authored-by: Manuel Ceron <manuel.ceron@jetbrains.com>
3 years agoReturn a better error message for when we are waiting for cargo.
Manuel Ceron [Wed, 7 Apr 2021 11:25:49 +0000 (13:25 +0200)]
Return a better error message for when we are waiting for cargo.

3 years agoMerge #8396
bors[bot] [Wed, 7 Apr 2021 11:18:20 +0000 (11:18 +0000)]
Merge #8396

8396: Uncouple Ty::builtin_deref and Ty::def_crates from Ty r=Veykril a=Veykril

bors r+
CC #8313

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoFree Ty::def_crates
Lukas Wirth [Wed, 7 Apr 2021 11:09:31 +0000 (13:09 +0200)]
Free Ty::def_crates

3 years agoMove Ty::builtin_deref
Lukas Wirth [Wed, 7 Apr 2021 11:06:48 +0000 (13:06 +0200)]
Move Ty::builtin_deref

3 years agoMerge #8394
bors[bot] [Wed, 7 Apr 2021 09:35:40 +0000 (09:35 +0000)]
Merge #8394

8394: Infer variants through type aliased enums r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoInfer variants through type aliased enums
Lukas Wirth [Wed, 7 Apr 2021 09:31:50 +0000 (11:31 +0200)]
Infer variants through type aliased enums

3 years agoMerge #8392
bors[bot] [Wed, 7 Apr 2021 03:54:28 +0000 (03:54 +0000)]
Merge #8392

8392: Add space after lifetime in expand macro r=edwin0cheng a=sharksforarms

When a lifetime is followed by an ident, this lead to invalid syntax. This adds a whitespace between the lifetime and the identifier.

Noticed this here: https://github.com/simrat39/rust-tools.nvim/issues/2#issuecomment-814551847

Co-authored-by: Emmanuel Thompson <eet6646@gmail.com>
3 years agoAdd space after lifetime
Emmanuel Thompson [Wed, 7 Apr 2021 03:22:44 +0000 (23:22 -0400)]
Add space after lifetime

In macro expansion, this lead to invalid syntax

3 years agoMerge #8390
bors[bot] [Wed, 7 Apr 2021 01:35:00 +0000 (01:35 +0000)]
Merge #8390

8390: Support trait impls in unnamed consts r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoCollect trait impls inside unnamed consts
Jonas Schievink [Wed, 7 Apr 2021 01:33:22 +0000 (03:33 +0200)]
Collect trait impls inside unnamed consts

3 years agonameres: collect unnamed consts
Jonas Schievink [Wed, 7 Apr 2021 01:12:40 +0000 (03:12 +0200)]
nameres: collect unnamed consts

3 years agoMerge #8389
bors[bot] [Tue, 6 Apr 2021 23:47:39 +0000 (23:47 +0000)]
Merge #8389

8389: Do not import on the fly during fields of record literal syntax r=SomeoneToIgnore a=memoryruins

When only fields are relevant during record literal syntax (`Foo { field_$0 }`), RA already avoids completions of in-scope items, but with `rust-analyzer.completion.enableAutoimportCompletions` enabled, more than field names were eagerly suggested. This PR adds a case to `import_on_the_fly` to avoid the extra completions in this context.

Closes #8300

Co-authored-by: memoryruins <memoryruinsmusic@gmail.com>
3 years agoFix typo
memoryruins [Tue, 6 Apr 2021 23:38:59 +0000 (19:38 -0400)]
Fix typo

3 years agoDo not import on the fly during fields of record literal syntax
memoryruins [Tue, 6 Apr 2021 22:40:06 +0000 (18:40 -0400)]
Do not import on the fly during fields of record literal syntax

3 years agoMerge #8382
bors[bot] [Tue, 6 Apr 2021 22:23:41 +0000 (22:23 +0000)]
Merge #8382

8382: Make Fixture docs more accessible and fix small doc issues r=SomeoneToIgnore a=SomeoneToIgnore

Follow up of https://github.com/rust-analyzer/rust-analyzer/pull/8302#discussion_r607054896

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
3 years agoMerge #8387
bors[bot] [Tue, 6 Apr 2021 21:49:10 +0000 (21:49 +0000)]
Merge #8387

8387: Remove `SolutionVariables`, add ConstrainedSubst analogous to Chalk r=flodiebold a=flodiebold

... just missing the constraints.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoRemove `SolutionVariables`, add ConstrainedSubst analogous to Chalk
Florian Diebold [Tue, 6 Apr 2021 21:46:32 +0000 (23:46 +0200)]
Remove `SolutionVariables`, add ConstrainedSubst analogous to Chalk

... just missing the constraints.

3 years agoMerge #8386
bors[bot] [Tue, 6 Apr 2021 20:26:52 +0000 (20:26 +0000)]
Merge #8386

8386: Avoid O(n²) when constructing AttrSourceMap r=jonas-schievink a=jonas-schievink

Brings https://github.com/rust-analyzer/rust-analyzer/issues/8377 down to 2.52s on my machine. Not quite back to where it was before, so I'll leave that issue open for now.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAvoid O(n²) when constructing AttrSourceMap
Jonas Schievink [Tue, 6 Apr 2021 20:25:44 +0000 (22:25 +0200)]
Avoid O(n²) when constructing AttrSourceMap

3 years agoMerge #8385
bors[bot] [Tue, 6 Apr 2021 19:11:41 +0000 (19:11 +0000)]
Merge #8385

8385: Align `InferenceVar` to Chalk r=flodiebold a=flodiebold

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoAlign `InferenceVar` to Chalk
Florian Diebold [Tue, 6 Apr 2021 19:09:52 +0000 (21:09 +0200)]
Align `InferenceVar` to Chalk

3 years agoClean up Chalk mapping a bit
Florian Diebold [Tue, 6 Apr 2021 18:51:21 +0000 (20:51 +0200)]
Clean up Chalk mapping a bit

3 years agoMerge #8383
bors[bot] [Tue, 6 Apr 2021 18:49:42 +0000 (18:49 +0000)]
Merge #8383

8383: Update Zulip URL r=lnicola a=lnicola

bors r+

changelog skip

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoUpdate Zulip URL
Laurențiu Nicola [Tue, 6 Apr 2021 18:48:53 +0000 (21:48 +0300)]
Update Zulip URL

3 years agoAdjust fixture docs a bit
Kirill Bulatov [Tue, 6 Apr 2021 18:42:09 +0000 (21:42 +0300)]
Adjust fixture docs a bit

3 years agoSmall grammar fixes
Kirill Bulatov [Tue, 6 Apr 2021 15:37:41 +0000 (18:37 +0300)]
Small grammar fixes

3 years agoUpdate Zulip link and macro privacy statement
Kirill Bulatov [Tue, 6 Apr 2021 15:38:01 +0000 (18:38 +0300)]
Update Zulip link and macro privacy statement

3 years agoMerge #8379
bors[bot] [Tue, 6 Apr 2021 18:29:46 +0000 (18:29 +0000)]
Merge #8379

8379: internal: document broken windows r=jonas-schievink a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoMerge #8381
bors[bot] [Tue, 6 Apr 2021 18:20:38 +0000 (18:20 +0000)]
Merge #8381

8381: Lower attributes on tuple fields r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoLower attributes on tuple fields
Jonas Schievink [Tue, 6 Apr 2021 18:17:52 +0000 (20:17 +0200)]
Lower attributes on tuple fields

3 years agoMerge #8380
bors[bot] [Tue, 6 Apr 2021 17:44:58 +0000 (17:44 +0000)]
Merge #8380

8380: infer: remove `record_pat_field_resolutions` field r=jonas-schievink a=jonas-schievink

Same as https://github.com/rust-analyzer/rust-analyzer/pull/8376, this
can be computed from other data

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoinfer: remove `record_pat_field_resolutions` field
Jonas Schievink [Tue, 6 Apr 2021 17:44:28 +0000 (19:44 +0200)]
infer: remove `record_pat_field_resolutions` field

Same as https://github.com/rust-analyzer/rust-analyzer/pull/8376, this
can be computed from other data

3 years agointernal: document broken windows
Aleksey Kladov [Tue, 6 Apr 2021 17:11:42 +0000 (20:11 +0300)]
internal: document broken windows

3 years agoMerge #8371
bors[bot] [Tue, 6 Apr 2021 16:12:30 +0000 (16:12 +0000)]
Merge #8371

8371: Don't use HirDisplayWrapper when displaying SourceCode r=matklad a=Veykril

The issue was basically that when displaying for `DisplayTarget::SourceCode` some `hir_fmt` functions would create `HirDisplayWrapper`s which would then `fmt` these triggering the Display panic since `fmt::Display` can't fail the same way as `HirDisplay`. Simple fix is to just use `hir_fmt` directly. Should probably write that down somewhere in source, looking for a good spot to put that right now.

Fixes #8077, Fixes #8370

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #8376
bors[bot] [Tue, 6 Apr 2021 16:02:39 +0000 (16:02 +0000)]
Merge #8376

8376: infer: remove `record_field_resolutions` field r=flodiebold a=jonas-schievink

It stores no useful data, since we can derive all fields from
`variant_resolutions`

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoinfer: remove `record_field_resolutions` field
Jonas Schievink [Tue, 6 Apr 2021 15:59:18 +0000 (17:59 +0200)]
infer: remove `record_field_resolutions` field

It stores no useful data, since we can derive all fields from
`variant_resolutions`

3 years agoMerge #8375
bors[bot] [Tue, 6 Apr 2021 15:09:38 +0000 (15:09 +0000)]
Merge #8375

8375: feat: show errors from `cargo metadata` and initial `cargo check` in the status bar r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agofeat: show errors from `cargo metadata` and initial `cargo check` in the status bar
Aleksey Kladov [Tue, 6 Apr 2021 15:08:05 +0000 (18:08 +0300)]
feat: show errors from `cargo metadata` and initial `cargo check` in the status bar

closes #3155

3 years agoMerge #8374
bors[bot] [Tue, 6 Apr 2021 14:08:20 +0000 (14:08 +0000)]
Merge #8374

8374: Intern TypeRefs stored in Body r=jonas-schievink a=jonas-schievink

Minor improvement to memory usage (1 MB or so)

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoIntern TypeRefs stored in Body
Jonas Schievink [Tue, 6 Apr 2021 14:07:45 +0000 (16:07 +0200)]
Intern TypeRefs stored in Body

Minor improvement to memory usage (1 MB or so)

3 years agoMerge #8364
bors[bot] [Tue, 6 Apr 2021 13:43:37 +0000 (13:43 +0000)]
Merge #8364

8364: Memory usage improvements r=jonas-schievink a=alexmaco

These are mostly focused on splitting up enum variants with large size differences between variants by `Box`-ing things up.

In my testing this reduces the memory usage somewhere in the low percentages, even though the measurements are quite noisy.

Co-authored-by: Alexandru Macovei <alexnmaco@gmail.com>
3 years agoMerge #8368
bors[bot] [Tue, 6 Apr 2021 13:32:15 +0000 (13:32 +0000)]
Merge #8368

8368: Move Ty accessors to TyExt r=flodiebold a=Veykril

CC #8313

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoClearer naming
Aleksey Kladov [Tue, 6 Apr 2021 13:22:26 +0000 (16:22 +0300)]
Clearer naming

3 years agoAvoid duplicating VfsPath in vfs::path_interner::PathInterner by using an IndexSet
Alexandru Macovei [Thu, 1 Apr 2021 11:01:59 +0000 (14:01 +0300)]
Avoid duplicating VfsPath in vfs::path_interner::PathInterner by using an IndexSet

3 years agoUse Box'es to reduce the size of hir_def::expr::Pat from 112 to 64 bytes on 64bit
Alexandru Macovei [Tue, 30 Mar 2021 21:55:18 +0000 (00:55 +0300)]
Use Box'es to reduce the size of hir_def::expr::Pat from 112 to 64 bytes on 64bit

3 years agoUse Box'es to reduce size of hir_def::expr::Expr from 128 to 72 bytes (on 64bit systems)
Alexandru Macovei [Tue, 30 Mar 2021 20:06:57 +0000 (23:06 +0300)]
Use Box'es to reduce size of hir_def::expr::Expr from 128 to 72 bytes (on 64bit systems)

Rationale: only a minority of variants used almost half the size.
By keeping large members (especially in Option) behind a box
the memory cost is only payed when the large variants are needed.

This reduces the size Vec<Expr> needs to allocate.