]>
git.lizzy.rs Git - rust.git/log
Jonas Schievink [Thu, 8 Apr 2021 17:44:21 +0000 (19:44 +0200)]
Add `AttrId` to track attribute sources
bors[bot] [Fri, 9 Apr 2021 10:45:34 +0000 (10:45 +0000)]
Merge #8406
8406: Improve indexing of impls r=flodiebold a=flodiebold
Store impls for e.g. &Foo with the ones for Foo instead of the big "other" bucket. This can improve performance and simplifies the HIR impl search a bit.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Florian Diebold [Wed, 7 Apr 2021 17:35:24 +0000 (19:35 +0200)]
Improve indexing of impls
Store impls for e.g. &Foo with the ones for Foo instead of the big
"other" bucket. This can improve performance and simplifies the HIR impl
search a bit.
bors[bot] [Fri, 9 Apr 2021 09:18:42 +0000 (09:18 +0000)]
Merge #8440
8440: Fix crash on syn involving lifetimes returned by Chalk r=flodiebold a=flodiebold
If we get lifetime variables back in autoderef, just immediately replace them by static lifetimes for now. Method resolution doesn't really deal correctly with new variables being introduced (this needs to be fixed more properly).
This fixes `rust-analyzer analysis-stats --with-deps` crashing in the RA repo.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Florian Diebold [Thu, 8 Apr 2021 21:34:05 +0000 (23:34 +0200)]
Fix crash on syn involving lifetimes returned by Chalk
If we get lifetime variables back in autoderef, just immediately replace
them by static lifetimes for now. Method resolution doesn't really deal
correctly with new variables being introduced (this needs to be fixed
more properly).
This fixes `rust-analyzer analysis-stats --with-deps` crashing in the RA
repo.
bors[bot] [Thu, 8 Apr 2021 23:33:36 +0000 (23:33 +0000)]
Merge #8429
8429: 8425: Added documentation for on enter covering //! doc comments. r=jonas-schievink a=chetankhilosiya
Also added passing test case.
Co-authored-by: Chetan Khilosiya <chetan.khilosiya@gmail.com>
bors[bot] [Thu, 8 Apr 2021 21:11:53 +0000 (21:11 +0000)]
Merge #8433
8433: Intern lots of things r=jonas-schievink a=flodiebold
This uses the new interning infrastructure for most type-related things, where it had a positive effect on memory usage and performance. In total, this gives a slight performance improvement and a quite good memory reduction (1119MB->885MB on RA, 1774MB->1188MB on Diesel).
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Florian Diebold [Thu, 8 Apr 2021 19:15:01 +0000 (21:15 +0200)]
Cleanup
Florian Diebold [Thu, 8 Apr 2021 18:55:03 +0000 (20:55 +0200)]
Intern Variances
This may be a slight performance improvement.
Florian Diebold [Thu, 8 Apr 2021 18:39:43 +0000 (20:39 +0200)]
Don't intern ProgramClause at all
This seems to work best performance/memory-wise.
Florian Diebold [Thu, 8 Apr 2021 18:18:51 +0000 (20:18 +0200)]
Intern QuantifiedWhereClauses
Slight performance and memory usage improvement.
Florian Diebold [Thu, 8 Apr 2021 18:13:21 +0000 (20:13 +0200)]
Intern ProgramClauses
Florian Diebold [Thu, 8 Apr 2021 18:06:19 +0000 (20:06 +0200)]
Intern CanonicalVarKinds
Slight savings in performance and memory.
Florian Diebold [Thu, 8 Apr 2021 16:45:07 +0000 (18:45 +0200)]
Intern consts & lifetimes
Slight memory usage reduction.
Florian Diebold [Thu, 8 Apr 2021 16:32:20 +0000 (18:32 +0200)]
Intern types
Performance about the same, memory reduced by ~5%.
Florian Diebold [Thu, 8 Apr 2021 16:25:18 +0000 (18:25 +0200)]
Intern Substitutions
(Costs a bit of performance, reduces memory usage on RA by ~10%.)
Florian Diebold [Thu, 8 Apr 2021 16:13:02 +0000 (18:13 +0200)]
Intern VariableKinds
bors[bot] [Thu, 8 Apr 2021 19:47:54 +0000 (19:47 +0000)]
Merge #8431
8431: 8024: Added the trait highlight modifier for assoc types. r=Veykril a=chetankhilosiya
Co-authored-by: Chetan Khilosiya <chetan.khilosiya@gmail.com>
Chetan Khilosiya [Thu, 8 Apr 2021 19:30:35 +0000 (01:00 +0530)]
8024: Added the trait modifier for assoc types.
Chetan Khilosiya [Thu, 8 Apr 2021 19:01:07 +0000 (00:31 +0530)]
8425: Added documentation for on enter covering //! doc comments.
Also added passing test case.
bors[bot] [Thu, 8 Apr 2021 18:43:41 +0000 (18:43 +0000)]
Merge #8428
8428: Use named fields in `MacroCallKind` r=jonas-schievink a=jonas-schievink
bors r+
changelog skip
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Thu, 8 Apr 2021 18:43:07 +0000 (20:43 +0200)]
Use named fields in `MacroCallKind`
bors[bot] [Thu, 8 Apr 2021 16:51:11 +0000 (16:51 +0000)]
Merge #8426
8426: Track recursion limit when expanding custom derive r=jonas-schievink a=jonas-schievink
You can write a custom derive that expands to itself:
```rust
#[proc_macro_derive(Derive)]
pub fn derive(item: TokenStream) -> TokenStream {
let mut out: TokenStream = "#[derive(Derive)]".parse().unwrap();
out.extend(item);
out
}
```
rustc reports a recursion limit error, but rust-analyzer used to spin in name resolution and eventually fail with "name resolution is stuck". This makes it fail fast by respecting the recursion depth of the invocation.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Thu, 8 Apr 2021 16:49:30 +0000 (18:49 +0200)]
Track recursion limit when expanding custom derive
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>
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>
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
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>
Laurențiu Nicola [Thu, 8 Apr 2021 14:51:02 +0000 (17:51 +0300)]
Remove extra bracket in architecture docs
Laurențiu Nicola [Thu, 8 Apr 2021 14:20:14 +0000 (17:20 +0300)]
Reduce allocations in Expand macro
Florian Diebold [Thu, 8 Apr 2021 12:35:15 +0000 (14:35 +0200)]
Remove unused
Florian Diebold [Thu, 8 Apr 2021 12:21:22 +0000 (14:21 +0200)]
Replace `make_binders` by the now equivalent `make_only_type_binders`
Florian Diebold [Thu, 8 Apr 2021 12:16:05 +0000 (14:16 +0200)]
Remove identity impls for ToChalk
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.
Florian Diebold [Thu, 8 Apr 2021 11:51:04 +0000 (13:51 +0200)]
Fix missing match arms
Florian Diebold [Thu, 8 Apr 2021 11:32:56 +0000 (13:32 +0200)]
Fix remaining `interned_mut` call
Florian Diebold [Thu, 8 Apr 2021 11:32:48 +0000 (13:32 +0200)]
Replace remaining `fold` calls
Florian Diebold [Wed, 7 Apr 2021 19:26:37 +0000 (21:26 +0200)]
Replace some `fold` calls
Florian Diebold [Wed, 7 Apr 2021 19:26:24 +0000 (21:26 +0200)]
Fix shifted_{in,out} calls
Florian Diebold [Wed, 7 Apr 2021 19:17:51 +0000 (21:17 +0200)]
Fix subst_prefix
Florian Diebold [Wed, 7 Apr 2021 19:16:18 +0000 (21:16 +0200)]
Get rid of walk_mut [not compiling]
Florian Diebold [Wed, 7 Apr 2021 19:12:42 +0000 (21:12 +0200)]
Fix TyBuilder methods
Florian Diebold [Wed, 7 Apr 2021 19:10:28 +0000 (21:10 +0200)]
Impl Fold for CallableSig
Florian Diebold [Sat, 3 Apr 2021 15:49:29 +0000 (17:49 +0200)]
Add HasInterner bounds
Florian Diebold [Sat, 3 Apr 2021 15:42:13 +0000 (17:42 +0200)]
Allow unused
Florian Diebold [Sat, 3 Apr 2021 15:41:55 +0000 (17:41 +0200)]
Remove obsolete Cast impls
Florian Diebold [Sat, 3 Apr 2021 15:41:14 +0000 (17:41 +0200)]
Make ToChalk implementations identity
Florian Diebold [Sat, 3 Apr 2021 15:40:56 +0000 (17:40 +0200)]
Replace all the types by their Chalk versions
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