Commit graph

16282 commits

Author SHA1 Message Date
bors[bot]
428cf21143
Merge #8379
8379: internal: document broken windows r=jonas-schievink a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-06 18:29:46 +00:00
bors[bot]
bf11781ec9
Merge #8381
8381: Lower attributes on tuple fields r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-04-06 18:20:38 +00:00
Jonas Schievink
0d4c931416 Lower attributes on tuple fields 2021-04-06 20:19:53 +02:00
bors[bot]
52c0ecb982
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>
2021-04-06 17:44:58 +00:00
Jonas Schievink
230c763648 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
2021-04-06 19:44:28 +02:00
Aleksey Kladov
658776d4ed internal: document broken windows 2021-04-06 20:11:42 +03:00
bors[bot]
e6a1c9ca60
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>
2021-04-06 16:12:30 +00:00
bors[bot]
7dd7017547
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>
2021-04-06 16:02:39 +00:00
Jonas Schievink
e9752308bb infer: remove record_field_resolutions field
It stores no useful data, since we can derive all fields from
`variant_resolutions`
2021-04-06 17:59:18 +02:00
bors[bot]
74711deb72
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>
2021-04-06 15:09:38 +00:00
Aleksey Kladov
de33702784 feat: show errors from cargo metadata and initial cargo check in the status bar
closes #3155
2021-04-06 18:08:05 +03:00
bors[bot]
8e768a5a1f
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>
2021-04-06 14:08:20 +00:00
Jonas Schievink
a25fbdb30a Intern TypeRefs stored in Body
Minor improvement to memory usage (1 MB or so)
2021-04-06 16:07:45 +02:00
bors[bot]
7d39b13996
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>
2021-04-06 13:43:37 +00:00
bors[bot]
12e86433ab
Merge #8368
8368: Move Ty accessors to TyExt r=flodiebold a=Veykril

CC #8313

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-04-06 13:32:15 +00:00
Aleksey Kladov
9ec5e6e4fd Clearer naming 2021-04-06 16:22:26 +03:00
Alexandru Macovei
4e2a6ac7ea Avoid duplicating VfsPath in vfs::path_interner::PathInterner by using an IndexSet 2021-04-06 16:03:57 +03:00
Alexandru Macovei
32304d14a1 Use Box'es to reduce the size of hir_def::expr::Pat from 112 to 64 bytes on 64bit 2021-04-06 16:01:31 +03:00
Alexandru Macovei
fb1f544e24 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.
2021-04-06 16:01:31 +03:00
bors[bot]
4414071074
Merge #8355
8355: internal: do not drop errors from cargo metadata/check r=matklad a=matklad

Work towards #3155

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-04-06 12:50:25 +00:00
Aleksey Kladov
ad02bfe58f Sacrifice for the semicolon god 2021-04-06 15:50:02 +03:00
Aleksey Kladov
8fe20b19d4 More robust status notifications 2021-04-06 15:45:31 +03:00
Lukas Wirth
a43409fa43 Panic when creating a HirDisplayWrapper with DisplayTarget::SourceCode 2021-04-06 14:42:34 +02:00
Lukas Wirth
ffdb2da49d Don't use HirDisplayWrapper when displaying SourceCode 2021-04-06 14:21:35 +02:00
Lukas Wirth
bc993bbe85 Remove TyExt::dyn_trait_ref 2021-04-06 13:58:51 +02:00
Lukas Wirth
9b4699a9be Move Ty accessors to TyExt 2021-04-06 13:58:48 +02:00
bors[bot]
002e72a28d
Merge #8366
8366: Add chalk_ir::Const to TyKind::Array r=flodiebold a=Veykril

CC #8313

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-04-06 11:34:34 +00:00
Aleksey Kladov
9143e3925c Prepare for more stateless status reporting 2021-04-06 13:23:09 +03:00
Aleksey Kladov
e3c47ccefc Use autoreload config to gate execution rather that staleness 2021-04-06 13:10:50 +03:00
Lukas Wirth
9fbba7bc45 Add chalk_ir::Const to TyKind::Array 2021-04-06 11:45:41 +02:00
Aleksey Kladov
3698b3eab8 Avoid duplicate cargo checks 2021-04-06 12:40:31 +03:00
Aleksey Kladov
9ca59733e3 Improve readability
It's better to order functions in the order they are called, if there's
ordering between them.
2021-04-06 12:35:40 +03:00
Aleksey Kladov
aaa8c208b1 internal: do not drop errors from cargo metadata/check
Work towards #3155
2021-04-06 12:33:19 +03:00
bors[bot]
047b531301
Merge #8359
8359: Add Lifetime to TyKind::Ref and DynTy r=flodiebold a=Veykril

CC #8313

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-04-06 08:52:02 +00:00
Lukas Wirth
08dc69599e Use a constructor function for Static lifetimes 2021-04-06 10:50:55 +02:00
Lukas Wirth
b98c681cb7 Always use Static lifetimes in chalk mapping 2021-04-06 10:45:34 +02:00
Lukas Wirth
9da191c7e0 Add Lifetime to DynTy 2021-04-06 10:45:34 +02:00
Lukas Wirth
96756f1b1d Add Lifetime to TyKind::Ref 2021-04-06 10:45:30 +02:00
bors[bot]
4bc8a01830
Merge #8360
8360: Fix shifting of binders in FnPointer r=flodiebold a=flodiebold

 - don't shift in/out for Chalk mapping (we want to have the same binders now)
 - do shift in when creating the signature for a closure (though it shouldn't matter much)
 - do shift in when lowering a `fn()` type
 - correctly deal with the implied binder in TypeWalk

Tested with the binders validator on various repos, so I'm pretty sure this doesn't mess things up 😬 

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-04-05 21:03:01 +00:00
Florian Diebold
1ae967bf8e Fix shifting of binders in FnPointer
- don't shift in/out for Chalk mapping (we want to have the same
   binders now)
 - do shift in when creating the signature for a closure (though it
   shouldn't matter much)
 - do shift in when lowering a `fn()` type
 - correctly deal with the implied binder in TypeWalk
2021-04-05 23:00:50 +02:00
bors[bot]
7ce0e9c9ca
Merge #8358
8358: Align FnPointer with Chalk r=flodiebold a=flodiebold

CC #8313

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-04-05 20:25:13 +00:00
Florian Diebold
edc59d897d Align FnPointer with Chalk 2021-04-05 22:23:30 +02:00
bors[bot]
f25c1e7c6a
Merge #8356
8356: Align more methods to Chalk r=flodiebold a=flodiebold

Related to #8313.

Move some inherent methods that don't exist in Chalk to an extension trait, remove some others.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-04-05 19:59:25 +00:00
Florian Diebold
b67148daea Substitution::prefix -> subst_prefix
I probably want to get rid of this function completely later.
2021-04-05 21:58:53 +02:00
Florian Diebold
2a83645e1b Get rid of Substitution::suffix 2021-04-05 21:58:03 +02:00
Florian Diebold
b443e5304e Remove some unused methods, move some to types.rs 2021-04-05 21:58:03 +02:00
Florian Diebold
738174671a Binders::wrap_empty -> wrap_empty_binders 2021-04-05 21:58:03 +02:00
Florian Diebold
2f5a77658b Substitution::single -> from1 2021-04-05 21:58:03 +02:00
Florian Diebold
788533d380 Move ProjectionTy methods to extension trait 2021-04-05 21:58:01 +02:00
bors[bot]
8c96a7d81e
Merge #8353
8353: Replace hir_ty::Lifetime with chalk equivalent r=flodiebold a=Veykril

Our `Lifetime` isn't really used yet so this is a rather simple change

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-04-05 19:34:50 +00:00