]>
git.lizzy.rs Git - rust.git/log
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>
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>
Lukas Wirth [Wed, 7 Apr 2021 22:05:08 +0000 (00:05 +0200)]
Emit folding ranges for multiline array literals
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>
Florian Diebold [Wed, 7 Apr 2021 18:50:26 +0000 (20:50 +0200)]
Fix return type of Substitution::interned
Florian Diebold [Wed, 7 Apr 2021 18:48:58 +0000 (20:48 +0200)]
InEnvironment::new takes a reference
Florian Diebold [Wed, 7 Apr 2021 18:47:04 +0000 (20:47 +0200)]
Make Canonical::new a free-standing function
Florian Diebold [Wed, 7 Apr 2021 18:41:52 +0000 (20:41 +0200)]
Fix return type of `self_type_parameter`
Florian Diebold [Wed, 7 Apr 2021 18:40:01 +0000 (20:40 +0200)]
Move hir_trait_id to extension trait
Florian Diebold [Wed, 7 Apr 2021 18:26:27 +0000 (20:26 +0200)]
Change TraitRef::hir_fmt_ext to free-standing function
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>
Jonas Schievink [Wed, 7 Apr 2021 18:19:28 +0000 (20:19 +0200)]
Update `OUT_DIR` diagnostic to match setting
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>
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>
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).
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>
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.
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>
kjeremy [Wed, 7 Apr 2021 15:39:33 +0000 (11:39 -0400)]
Update crates
Jonas Schievink [Wed, 7 Apr 2021 15:19:42 +0000 (17:19 +0200)]
Document `}` insertion
Jonas Schievink [Wed, 7 Apr 2021 14:44:25 +0000 (16:44 +0200)]
Make better use of `stdx::always`
Jonas Schievink [Wed, 7 Apr 2021 14:37:47 +0000 (16:37 +0200)]
Rewrite, reparse modified file
Jonas Schievink [Tue, 6 Apr 2021 23:39:17 +0000 (01:39 +0200)]
simplify
Jonas Schievink [Tue, 6 Apr 2021 23:26:22 +0000 (01:26 +0200)]
Use stdx::always
Jonas Schievink [Tue, 6 Apr 2021 23:24:24 +0000 (01:24 +0200)]
Complete braces more aggressively
Jonas Schievink [Tue, 6 Apr 2021 21:55:39 +0000 (23:55 +0200)]
Autoclose blocks when typing `{`
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>
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.
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>
Lukas Wirth [Wed, 7 Apr 2021 11:09:31 +0000 (13:09 +0200)]
Free Ty::def_crates
Lukas Wirth [Wed, 7 Apr 2021 11:06:48 +0000 (13:06 +0200)]
Move Ty::builtin_deref
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>
Lukas Wirth [Wed, 7 Apr 2021 09:31:50 +0000 (11:31 +0200)]
Infer variants through type aliased enums
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>
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
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>
Jonas Schievink [Wed, 7 Apr 2021 01:33:22 +0000 (03:33 +0200)]
Collect trait impls inside unnamed consts
Jonas Schievink [Wed, 7 Apr 2021 01:12:40 +0000 (03:12 +0200)]
nameres: collect unnamed consts
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>
memoryruins [Tue, 6 Apr 2021 23:38:59 +0000 (19:38 -0400)]
Fix typo
memoryruins [Tue, 6 Apr 2021 22:40:06 +0000 (18:40 -0400)]
Do not import on the fly during fields of record literal syntax
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>
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>
Florian Diebold [Tue, 6 Apr 2021 21:46:32 +0000 (23:46 +0200)]
Remove `SolutionVariables`, add ConstrainedSubst analogous to Chalk
... just missing the constraints.
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>
Jonas Schievink [Tue, 6 Apr 2021 20:25:44 +0000 (22:25 +0200)]
Avoid O(n²) when constructing AttrSourceMap
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>
Florian Diebold [Tue, 6 Apr 2021 19:09:52 +0000 (21:09 +0200)]
Align `InferenceVar` to Chalk
Florian Diebold [Tue, 6 Apr 2021 18:51:21 +0000 (20:51 +0200)]
Clean up Chalk mapping a bit
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>
Laurențiu Nicola [Tue, 6 Apr 2021 18:48:53 +0000 (21:48 +0300)]
Update Zulip URL
Kirill Bulatov [Tue, 6 Apr 2021 18:42:09 +0000 (21:42 +0300)]
Adjust fixture docs a bit
Kirill Bulatov [Tue, 6 Apr 2021 15:37:41 +0000 (18:37 +0300)]
Small grammar fixes
Kirill Bulatov [Tue, 6 Apr 2021 15:38:01 +0000 (18:38 +0300)]
Update Zulip link and macro privacy statement
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>
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>
Jonas Schievink [Tue, 6 Apr 2021 18:17:52 +0000 (20:17 +0200)]
Lower attributes on tuple fields
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>
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
Aleksey Kladov [Tue, 6 Apr 2021 17:11:42 +0000 (20:11 +0300)]
internal: document broken windows
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>
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>
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`
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>
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
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>
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)
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>
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>
Aleksey Kladov [Tue, 6 Apr 2021 13:22:26 +0000 (16:22 +0300)]
Clearer naming
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
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
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.
bors[bot] [Tue, 6 Apr 2021 12:50:25 +0000 (12:50 +0000)]
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>
Aleksey Kladov [Tue, 6 Apr 2021 12:50:02 +0000 (15:50 +0300)]
Sacrifice for the semicolon god
Aleksey Kladov [Tue, 6 Apr 2021 11:16:35 +0000 (14:16 +0300)]
More robust status notifications
Lukas Wirth [Tue, 6 Apr 2021 12:42:34 +0000 (14:42 +0200)]
Panic when creating a HirDisplayWrapper with DisplayTarget::SourceCode
Lukas Wirth [Tue, 6 Apr 2021 12:16:07 +0000 (14:16 +0200)]
Don't use HirDisplayWrapper when displaying SourceCode
Lukas Wirth [Tue, 6 Apr 2021 10:40:11 +0000 (12:40 +0200)]
Remove TyExt::dyn_trait_ref
Lukas Wirth [Tue, 6 Apr 2021 10:36:12 +0000 (12:36 +0200)]
Move Ty accessors to TyExt
bors[bot] [Tue, 6 Apr 2021 11:34:34 +0000 (11:34 +0000)]
Merge #8366
8366: Add chalk_ir::Const to TyKind::Array r=flodiebold a=Veykril
CC #8313
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Aleksey Kladov [Tue, 6 Apr 2021 10:23:09 +0000 (13:23 +0300)]
Prepare for more stateless status reporting
Aleksey Kladov [Tue, 6 Apr 2021 10:10:50 +0000 (13:10 +0300)]
Use autoreload config to gate execution rather that staleness
Lukas Wirth [Tue, 6 Apr 2021 09:45:41 +0000 (11:45 +0200)]
Add chalk_ir::Const to TyKind::Array
Aleksey Kladov [Tue, 6 Apr 2021 09:40:31 +0000 (12:40 +0300)]
Avoid duplicate `cargo check`s
Aleksey Kladov [Tue, 6 Apr 2021 09:35:40 +0000 (12:35 +0300)]
Improve readability
It's better to order functions in the order they are called, if there's
ordering between them.
Aleksey Kladov [Mon, 5 Apr 2021 19:30:19 +0000 (22:30 +0300)]
internal: do not drop errors from cargo metadata/check
Work towards #3155
bors[bot] [Tue, 6 Apr 2021 08:52:02 +0000 (08:52 +0000)]
Merge #8359
8359: Add Lifetime to TyKind::Ref and DynTy r=flodiebold a=Veykril
CC #8313
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Tue, 6 Apr 2021 08:50:55 +0000 (10:50 +0200)]
Use a constructor function for Static lifetimes
Lukas Wirth [Mon, 5 Apr 2021 21:01:34 +0000 (23:01 +0200)]
Always use Static lifetimes in chalk mapping
Lukas Wirth [Mon, 5 Apr 2021 20:12:40 +0000 (22:12 +0200)]
Add Lifetime to DynTy
Lukas Wirth [Mon, 5 Apr 2021 20:08:16 +0000 (22:08 +0200)]
Add Lifetime to TyKind::Ref
bors[bot] [Mon, 5 Apr 2021 21:03:01 +0000 (21:03 +0000)]
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 :grimacing:
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Florian Diebold [Mon, 5 Apr 2021 20:32:58 +0000 (22:32 +0200)]
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
bors[bot] [Mon, 5 Apr 2021 20:25:13 +0000 (20:25 +0000)]
Merge #8358
8358: Align FnPointer with Chalk r=flodiebold a=flodiebold
CC #8313
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Florian Diebold [Mon, 5 Apr 2021 20:23:16 +0000 (22:23 +0200)]
Align FnPointer with Chalk
bors[bot] [Mon, 5 Apr 2021 19:59:25 +0000 (19:59 +0000)]
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>
Florian Diebold [Mon, 5 Apr 2021 19:56:40 +0000 (21:56 +0200)]
Substitution::prefix -> subst_prefix
I probably want to get rid of this function completely later.
Florian Diebold [Mon, 5 Apr 2021 19:49:27 +0000 (21:49 +0200)]
Get rid of Substitution::suffix
Florian Diebold [Mon, 5 Apr 2021 19:29:20 +0000 (21:29 +0200)]
Remove some unused methods, move some to types.rs