Florian Diebold
6133e6a002
Extract coercion logic to InferenceTable
...
To make it accessible without an InferenceContext.
2022-03-21 16:45:30 +01:00
bors[bot]
6a0b199c82
Merge #11776
...
11776: Replace write! with direct `Formatter` calls r=Veykril a=lnicola
The final executable is somehow larger (36 239 296 vs 36 238 336 bytes), but this saves us a bit of `text` and `data`:
```
text data bss dec hex filename
23719199 1126625 4377 24850201 17b2f19 rust-analyzer-baseline
23716027 1126377 4377 24846781 17b21bd rust-analyzer-pr
```
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2022-03-21 09:04:40 +00:00
Laurențiu Nicola
1a37b17162
Replace write! with direct calls
2022-03-21 10:43:36 +02:00
bors[bot]
b594f9c441
Merge #11690
...
11690: feat: Add an assist for inlining type aliases r=Veykril a=steven-joruk
I'm working towards implementing #10881 , but I'd like to get this in first with earlier feedback.
Is `inline_type_alias` a good enough name? I guess the follow up assist would be called `inline_type_alias_into_all_users` based on that.
![valid_inlines](https://user-images.githubusercontent.com/1277939/158020510-fed78b5c-4c7e-46d1-9151-3044a29b9990.gif )
![invalid_inlines](https://user-images.githubusercontent.com/1277939/158020516-8a2deb6d-c6ec-4adf-a15b-c514fc97dc43.gif )
Co-authored-by: Steven Joruk <steven@joruk.com>
2022-03-20 21:15:49 +00:00
Steven Joruk
1381a2de23
refactor: Do more work in inline_type_alias closure
2022-03-20 20:53:03 +00:00
bors[bot]
6f2b118605
Merge #11775
...
11775: internal: Treat `global_asm` and `asm` macros as unsafe r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-20 18:31:27 +00:00
Lukas Wirth
ddf144051a
internal: Treat {global_}asm macros as unsafe
2022-03-20 19:31:00 +01:00
bors[bot]
fedf724d82
Merge #11774
...
11774: feat: Tag macro calls as unsafe if they expand to unsafe expressions r=Veykril a=Veykril
as long as they aren't inside an unsafe block inside the macro that is.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-20 18:15:29 +00:00
Lukas Wirth
3b7b223b25
Simplify
2022-03-20 19:13:50 +01:00
Lukas Wirth
68de7b30e0
feat: Tag macro calls as unsafe if they expand to unsafe expressions
2022-03-20 19:07:44 +01:00
bors[bot]
966b692422
Merge #11771
...
11771: feat: Visualize compiler inserted reborrows via inlay hints r=Veykril a=Veykril
Disabled by default.
![image](https://user-images.githubusercontent.com/3757771/159165178-baaf968a-4381-468e-933f-5326ca1b203d.png )
Closes https://github.com/rust-analyzer/rust-analyzer/issues/11275
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-20 13:47:16 +00:00
Lukas Wirth
5a87f09a71
Update inlay hint feature docs
2022-03-20 14:41:27 +01:00
Lukas Wirth
37b48ceb8f
feat: Visualize compiler inserted reborrows via inlay hints
2022-03-20 14:38:16 +01:00
bors[bot]
a82caff588
Merge #11765
...
11765: fix: Fix closure hints using macro ranges r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-19 19:26:34 +00:00
Lukas Wirth
2598575a35
fix: Fix closure hints using macro ranges
2022-03-19 20:24:09 +01:00
bors[bot]
7315d97347
Merge #11755
...
11755: feat: Implement lifetime elision hints r=Veykril a=Veykril
With names on:
![Code_erl26zKvuf](https://user-images.githubusercontent.com/3757771/159134856-e2c75d2d-f17c-45c7-9a78-3da5ee8b1acd.png )
With names off:
![Code_MRP1Pbfe9d](https://user-images.githubusercontent.com/3757771/159134857-30fac3a1-825e-4f49-ba9b-9fa0bb215694.png )
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-19 19:15:06 +00:00
Lukas Wirth
7da5b80f25
Change skip trivial behaviour
2022-03-19 20:12:14 +01:00
Lukas Wirth
7ab0aaa82a
Add option to skip trivial cases
2022-03-19 19:01:19 +01:00
Lukas Wirth
45756c823f
Use numbers for lifetimes by default, add setting to prefer using parameter names
2022-03-19 18:11:56 +01:00
bors[bot]
85311a8627
Merge #11761
...
11761: internal: Rename call info to "signature help" r=jonas-schievink a=jonas-schievink
It is no longer limited to just calls
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-03-18 19:30:52 +00:00
Jonas Schievink
55d2a25123
Rename call info to "signature help"
...
It is no longer limited to just calls
2022-03-18 20:19:35 +01:00
bors[bot]
8c16b07c07
Merge #11760
...
11760: feat: Provide signature help when editing generic args r=jonas-schievink a=jonas-schievink
![screenshot-2022-03-18-19:48:14](https://user-images.githubusercontent.com/1786438/159067106-3917a355-ca77-4d23-ad56-945dcc945425.png )
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-03-18 19:01:25 +00:00
Jonas Schievink
0642724e94
Provide signature help when editing generic args
2022-03-18 19:59:41 +01:00
Lukas Wirth
c22fed895e
Fix test fixtures
2022-03-18 18:57:15 +01:00
Lukas Wirth
b634d99361
Give the lifetimes better names
2022-03-18 18:55:03 +01:00
Lukas Wirth
673e2b1d8f
feat: Implement lifetime elision hints
2022-03-18 18:11:16 +01:00
bors[bot]
e3217c5015
Merge #11752
...
11752: internal: Allow explicitly specifying end of fixture annotation r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-18 16:38:32 +00:00
Lukas Wirth
890f98f21f
internal: Allow explicitly specifying end of fixture annotation
2022-03-18 15:42:19 +01:00
bors[bot]
97c7321cfa
Merge #11753
...
11753: feat: Complete assoc const patterns on builtin types r=jonas-schievink a=jonas-schievink
followup to https://github.com/rust-analyzer/rust-analyzer/pull/11713
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-03-18 14:37:59 +00:00
Jonas Schievink
14203c6378
Complete assoc const patterns on builtin types
2022-03-18 15:36:18 +01:00
bors[bot]
849ac25f05
Merge #11713
...
11713: Complete associated consts in patterns r=jonas-schievink a=hi-rustin
Try close https://github.com/rust-analyzer/rust-analyzer/issues/11555
Co-authored-by: hi-rustin <rustin.liu@gmail.com>
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2022-03-18 13:54:09 +00:00
Jonas Schievink
e7564086f4
Update crates/ide_completion/src/tests/pattern.rs
2022-03-18 14:53:44 +01:00
bors[bot]
6ad8c022ed
Merge #11750
...
11750: fix: Fix runnables trying to add doc tests in the crate root from #[macro_export] macros r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11746
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-18 11:13:37 +00:00
Lukas Wirth
828196be3b
fix: Fix runnables trying to add doc tests in the crate root from #[macro_export] macros
2022-03-18 12:01:59 +01:00
bors[bot]
38d2a9763b
Merge #11747
...
11747: minor: Remove Update GitHub API token command r=lnicola a=lnicola
bors r+
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2022-03-18 07:19:42 +00:00
Laurențiu Nicola
031967383e
Remove Update GitHub API token command
2022-03-18 09:19:02 +02:00
bors[bot]
6e13de6483
Merge #11744
...
11744: Bump deps r=lnicola a=lnicola
bors r+
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2022-03-17 17:25:07 +00:00
Laurențiu Nicola
86b1ef9ab2
Bump deps
2022-03-17 19:24:37 +02:00
bors[bot]
dbc697cb7d
Merge #11743
...
11743: fix: Properly unify receivers during method resolution r=flodiebold a=flodiebold
This fixes our type inference problems with `DynMap`; the problem there were the projection types in
```rust
impl<P: Policy> KeyMap<Key<P::K, P::V, P>>
```
which messed up the naive type equality check we did. It also actually simplifies the logic though, IMO. I also added a fix for associated const resolution that I noticed (visibility not being taken into account).
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2022-03-17 16:28:21 +00:00
Florian Diebold
60aeb8fa1a
Move fallback_bound_vars to the only place it's used now
2022-03-17 17:08:43 +01:00
Florian Diebold
9ea2e0bd5b
Fixes for consts
2022-03-17 17:04:32 +01:00
Florian Diebold
59b5696aaa
Snapshot obligations
2022-03-17 17:04:32 +01:00
Florian Diebold
8f5b6ac556
Properly try unifying the receivers during method resolution
...
Instead of hackily checking if they're equal.
2022-03-17 17:03:54 +01:00
hi-rustin
bc8665e14d
Fix typo
...
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-03-17 22:59:47 +08:00
Florian Diebold
1b71cd074d
Add test for DynMap type inference
2022-03-17 15:44:14 +01:00
hi-rustin
2bc545d9ef
Match the enum and union
...
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-03-17 21:38:21 +08:00
bors[bot]
631b504991
Merge #11741
...
11741: Emit #[must_use] in Generate enum is_variant assist r=lnicola a=lnicola
bors r+
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2022-03-17 13:23:22 +00:00
bors[bot]
0a18e4355a
Merge #11740
...
11740: Insert #[must_use] in generate_is_empty_from_len r=lnicola a=Walther
Inserts `#[must_use]` for the generated `is_empty` methods. I also added the `#[must_use]` for the `len()` methods in the documentation examples and tests for this generator while at it, to make sure they too encourage the use of the annotation.
From discussion in https://github.com/rust-analyzer/rust-analyzer/issues/11736 and https://github.com/rust-analyzer/rust-analyzer/pull/11738
Co-authored-by: Walther <veeti.haapsamo@gmail.com>
2022-03-17 13:14:26 +00:00
Laurențiu Nicola
de53232ada
Emit #[must_use] in Generate enum is_variant assist
2022-03-17 15:10:25 +02:00
Walther
217b30568e
Insert #[must_use] in generate_is_empty_from_len
2022-03-17 15:03:02 +02:00