Commit Graph

24097 Commits

Author SHA1 Message Date
Brent Westbrook
150da92b5c return immediately from render_record_lit if snippet_cap is None
this is the record literal version of #13805, which handled the same issue for
tuple literals
2023-01-04 12:55:05 -05:00
bvanjoi
ae73628f6b fix: keep whitespace in extract function handler 2023-01-04 22:10:17 +08:00
Ryo Yoshida
21ea0048cd
fix: unescape inline module names in module resolution 2023-01-04 18:22:01 +09:00
bors
a97c71f92d Auto merge of #13887 - Veykril:rustc-diag-preferred, r=Veykril
Only set machine-applicable rustc diagnostics as preferred

If they aren't machine applicable, then they might not be what the user wants, disrupting the workflow.
Example being:
![image](https://user-images.githubusercontent.com/3757771/210380233-ae25aa04-954e-4634-8dd1-4377cc2bd837.png)
Prior to the PR this the diagnostic quickfix was at the top, but usually isn't what the user wants.
2023-01-03 14:47:18 +00:00
Lukas Wirth
b6bb1e9ae7 Only set machine-applicable rustc diagnostics as preferred 2023-01-03 15:46:08 +01:00
bors
0b14cd9671 Auto merge of #13886 - Veykril:inlay-ligatures, r=Veykril
Use ZWNJ to prevent VSCode from forming ligatures between hints and code

Turns out VSCode still has this issue for native hints as well, cc https://github.com/rust-lang/rust-analyzer/pull/6236
2023-01-03 11:33:17 +00:00
Lukas Wirth
c4d8cf1dad Use ZWNJ to prevent VSCode from forming ligatures between hints and code 2023-01-03 12:32:38 +01:00
bors
5033213fc9 Auto merge of #13885 - Veykril:bin-op-adjust, r=Veykril
Skip lifetime elision on fn pointers and fn trait types

These currently don't work correctly, so it's better to not render them at all there
2023-01-03 10:59:21 +00:00
Lukas Wirth
b996a54cd8 Skip lifetime elision on fn pointers and fn trait types 2023-01-03 11:58:31 +01:00
bors
50801b7d6a Auto merge of #13853 - veber-alex:diag_fix, r=Veykril
Use diagnostic code as link to full message

fixes #13823 by adding a vscode setting that will keeping the existing diagnostic code and use it as a link to the full compiler error message.
While I was there I also fixed `index` to fallback to `rendered.length` to make the previewRustcOutput feature work.
2023-01-03 09:40:20 +00:00
Alex Veber
ddc0147d53 Fix diagnostic code 2023-01-03 08:33:27 +02:00
Donny/강동윤
4f369427b5 increase limit 2023-01-03 13:16:06 +09:00
bors
e75e2f8368 Auto merge of #13882 - Veykril:bin-op-adjust, r=Veykril
Write down adjustments introduced by binary operators
2023-01-02 22:17:11 +00:00
Lukas Wirth
506895fa2f Fix spelling mistake 2023-01-02 23:16:26 +01:00
Lukas Wirth
f51111aacb Write down adjustments introduced by binary operators 2023-01-02 23:16:09 +01:00
Daniel Eades
bb083b8202 remove useless casts 2023-01-02 15:02:54 +00:00
Daniel Eades
aa90d02079 remove useless operations 2023-01-02 15:02:54 +00:00
Daniel Eades
0a0817905e return value directly from if/else block 2023-01-02 15:02:54 +00:00
Daniel Eades
4f8ffd0ba4 remove unnecessary lifetimes that can be elided 2023-01-02 15:02:54 +00:00
Daniel Eades
8615bba105 use 'unwrap_or_default' 2023-01-02 15:02:54 +00:00
Daniel Eades
efd2c20e96 remove useless conversions 2023-01-02 15:02:54 +00:00
Daniel Eades
cc80c5bd07 remove unnecessary lazy evaluations 2023-01-02 15:02:54 +00:00
Daniel Eades
7530d76f00 use pointer args 2023-01-02 14:52:32 +00:00
Daniel Eades
ed128872eb remove needless borrows 2023-01-02 14:52:32 +00:00
Daniel Eades
77051679d7 use inline format args 2023-01-02 14:52:32 +00:00
bors
17cc78f169 Auto merge of #13832 - Veykril:discriminant-hints, r=Veykril
Enum variant discriminants hints

![image](https://user-images.githubusercontent.com/3757771/209320042-eced617a-9a47-4808-ac23-916f469dc90c.png)
2023-01-02 13:20:33 +00:00
bors
790759fb11 Auto merge of #13854 - lowr:fix/mbe-glue-punct, r=Veykril
Support multi-character punct tokens in MBE

Fixes #11497

In the context of MBE, consecutive puncts are parsed as multi-character punct tokens whenever possible. For example, `:::` is parsed as ``[Punct(`::`), Punct(`:`)]`` and shouldn't get matched to patterns like `: : :` or `: ::`.

We have implemented this behavior only for when we match puncts against `tt` fragments, but not when we match puncts literally. This PR extracts the multi-character punct handling procedure into a separate method and extends its support for literal matching.

For good measure, this PR adds support for `<-` token, which is still [considered as one token in rustc](e396186407/compiler/rustc_ast/src/token.rs (L249)) despite the placement syntax having been removed.
2023-01-02 13:07:42 +00:00
bors
e986de0b28 Auto merge of #13877 - lowr:fix/find-path-prefix-shadowed-prelude, r=Veykril
fix: prefix prelude items whose name collides in current scope

Fixes #13873

When we assemble path for prelude items whose name collides with other item in scope, we should always prefix it with module paths.
2023-01-02 12:11:30 +00:00
Ryo Yoshida
cf2fa14db5
fix: prefix prelude items whose name collides in current scope 2023-01-02 20:50:45 +09:00
Laurențiu Nicola
34bc240e94 Package release artifacts as ZIP 2023-01-01 20:45:08 +02:00
bors
643bc02ded Auto merge of #13875 - Veykril:private-field-diag, r=Veykril
Diagnose private assoc item accesses
2023-01-01 12:25:27 +00:00
Lukas Wirth
eee7de0225 Diagnose private assoc item accesses 2023-01-01 13:24:48 +01:00
bors
f31733b1d6 Auto merge of #13871 - lowr:fix/extract-module-merge-multiple-ranges, r=lnicola
fix: merge multiple intersecting ranges

Fixes #13791

In `check_intersection_and_push()`, there may exist two ranges we should merge with the new one. We've been assuming there should be only one range that intersects, which lead to [this assertion](da15d92a32/crates/text-edit/src/lib.rs (L192)) to fail under specific circumstances.
2022-12-31 14:51:27 +00:00
bors
da15d92a32 Auto merge of #13870 - Veykril:private-field-diag, r=Veykril
Diagnose private field accesses
2022-12-31 13:21:53 +00:00
Lukas Wirth
e3d144d17f Diagnose private field accesses 2022-12-31 14:20:59 +01:00
Ryo Yoshida
332dd6ad6e
fix: merge multiple intersecting ranges 2022-12-31 22:08:53 +09:00
bors
f5e7bf2ea5 Auto merge of #13869 - Veykril:exit-points, r=Veykril
Improve exit point highlighting for non-loop loops in tail position
2022-12-31 11:08:54 +00:00
Lukas Wirth
ec125fe46a Improve exit point highlighting for non-loop loops in tail position 2022-12-31 12:08:25 +01:00
bors
dbeee3445d Auto merge of #13867 - Veykril:meth-res-fallback, r=Veykril
Fallback to invisible associated functions and constants if no visible resolutions are found

Still lacking tests, will add those later
Fixes https://github.com/rust-lang/rust-analyzer/issues/13126
2022-12-31 10:53:30 +00:00
Lukas Wirth
1d782a9095 Add test for private method inference fallback 2022-12-31 11:42:44 +01:00
Daniel Eades
b196e5b2f6 fixup 2022-12-31 09:26:58 +00:00
bors
f1c4150c93 Auto merge of #13868 - lowr:patch/unused-known-names-bye, r=Veykril
minor: remove unused known `Name`s

After #13866, known `Name`s for safe intrinsics are no longer used and thus should be removed.
2022-12-31 08:23:22 +00:00
Ryo Yoshida
0430b68398
Remove unused known Names 2022-12-31 16:17:38 +09:00
Lukas Wirth
5d54c550e7 Fallback to invisible associated functions and constants if no visible resolutions are found 2022-12-30 23:56:08 +01:00
bors
0d76b94c90 Auto merge of #13866 - Nilstrieb:rustc_safe_intrinsic, r=Veykril
Use `rustc_safe_intrinsic` attribute to check for intrinsic safety

Instead of maintaining a list that is poorly kept in sync we can just use the attribute.

This will make new RA versions unusable with old toolchains that don't have the attribute yet. Should we keep maintaining the list as a fallback or just don't care?
2022-12-30 22:14:31 +00:00
bors
09bc37c849 Auto merge of #13861 - danieleades:derive-hash, r=Veykril
derive 'Hash'

clippy doesn't like that `PartialEq` is derived, and `Hash` is manually implemented. This PR resolves that by deriving the `Hash` implementation.
2022-12-30 22:01:20 +00:00
bors
20b0ae4afe Auto merge of #13857 - WaffleLapkin:yeet, r=Veykril
feat: Implement yeeting

See tracking issue: https://github.com/rust-lang/rust/issues/96373

Before:
![2022-12-29_03-19](https://user-images.githubusercontent.com/38225716/209884634-e34e98fb-615d-4954-9614-7f9ce6291678.png)
After:
![2022-12-29_03-21](https://user-images.githubusercontent.com/38225716/209884633-4bba5eba-6dcc-4714-86cb-5c0d1f358364.png)
2022-12-30 21:48:23 +00:00
bors
ea8897c9be Auto merge of #13856 - WaffleLapkin:typeck_try{}, r=Veykril
fix: Type check unstable `try{}` blocks

![Peek 2022-12-29 01-40](https://user-images.githubusercontent.com/38225716/209875594-8bf9c9e2-9998-40b0-8820-28c7f2d9bae4.gif)

Fixes https://github.com/rust-lang/rust-analyzer/issues/11843
2022-12-30 21:35:46 +00:00
bors
6892b16336 Auto merge of #13865 - lnicola:nits2, r=Veykril
minor: Tweak Clippy policy wording and drop a useless `format!`
2022-12-30 21:20:43 +00:00
Nilstrieb
72afcf2cad Use rustc_safe_intrinsic attribute to check for intrinsic safety
Instead of maintaining a list that is poorly kept in sync we can just
use the attribute.
2022-12-30 20:29:37 +01:00