269107 Commits

Author SHA1 Message Date
Giga Bowser
d0de3fa7ca Rework generate_fn_type_alias 2024-10-24 17:54:58 -04:00
Giga Bowser
a00b4c2a52 Add ty_fn_ptr function to create function pointer type 2024-10-24 17:46:14 -04:00
Giga Bowser
0ac5c8a842 Fix alphabetical order of handlers
No idea how this slipped past me
2024-10-23 11:54:48 -04:00
Giga Bowser
af3f9900cc Add assist to generate a type alias for a function 2024-10-23 11:31:15 -04:00
Lukas Wirth
1fbaccd893
Merge pull request #18264 from ChayimFriedman2/semi-transparent
fix: Implement mixed site hygiene
2024-10-23 12:33:50 +00:00
Lukas Wirth
c8a04e3a21
Merge pull request #18379 from usamoi/master
fix dyn incompatible hint message
2024-10-23 10:25:43 +00:00
usamoi
ac3db41b39 fix dyn incompatible hint message 2024-10-23 18:10:14 +08:00
Lukas Wirth
bde2000a98
Merge pull request #18376 from Veykril/veykril/push-ptmnsoqzsmqk
feat: Add text edits to more inlay hints
2024-10-23 08:39:25 +00:00
Lukas Wirth
4fdc63ce38 Don't emit edits for postfix adjustment hints 2024-10-23 10:24:58 +02:00
Lukas Wirth
41fc1fbaab Add text edit to implicit 'static hints 2024-10-23 09:58:20 +02:00
Lukas Wirth
49322a176f Add text edit to discriminant hints 2024-10-23 09:57:00 +02:00
Lukas Wirth
c92f76d7d7 Add text edit to binding mode hints 2024-10-23 09:52:03 +02:00
Lukas Wirth
cb816ad4f0 Add text edit to adjustment hints 2024-10-23 09:30:36 +02:00
Chayim Refael Friedman
8f36d1c94a Correctly resolve variables and labels from before macro definition in macro expansion
E.g.:
```rust
let v;
macro_rules! m { () => { v }; }
```

This was an existing bug, but it was less severe because unless the variable was shadowed it would be correctly resolved. With hygiene however, without this fix the variable is never resolved.
2024-10-22 21:49:17 +03:00
Chayim Refael Friedman
7ee25a0d70 Implement semitransparent hygiene
Or macro_rules hygiene, or mixed site hygiene. In other words, hygiene for variables and labels but not items.

The realization that made me implement this was that while "full" hygiene (aka. def site hygiene) is really hard for us to implement, and will likely involve intrusive changes and performance losses, since every `Name` will have to carry hygiene, mixed site hygiene is very local: it applies only to bodies, and we very well can save it in a side map with minor losses.

This fixes one diagnostic in r-a that was about `izip!()` using hygiene (yay!) but it introduces a huge number of others, because of #18262. Up until now this issue wasn't a major problem because it only affected few cases, but with hygiene identifiers referred by macros like that are not resolved at all. The next commit will fix that.
2024-10-22 21:26:56 +03:00
Lukas Wirth
fa59a76762
Merge pull request #18254 from ChayimFriedman2/fix-mut
fix: Nail destructuring assignment once and for all
2024-10-22 17:40:52 +00:00
Chayim Refael Friedman
983383f957 Add test for tuple struct destructuring assignment where the path comes from a macro 2024-10-22 20:27:09 +03:00
Lukas Wirth
ec7ad89850
Merge pull request #18373 from Veykril/veykril/push-mzumrrvynxqu
internal: Merge separate inlay hints targeting same range
2024-10-22 15:28:28 +00:00
Lukas Wirth
770df7ffbb Merge binding_mode inlay hints into one 2024-10-22 17:12:16 +02:00
Lukas Wirth
7c29f8c5b7 Merge adjustment inlay hints into one 2024-10-22 16:56:13 +02:00
Lukas Wirth
7aad1a2c4e Merge closure capture inlay hints into one 2024-10-22 16:29:15 +02:00
Marco Ieni
548224782c
Merge pull request #18372 from Kobzol/ci-merge-queue
Switch CI from bors to merge queues
2024-10-22 12:57:57 +00:00
bors
408f924758 Auto merge of #18370 - duncpro:goto-def-ranges, r=Veykril
feat: resolve range patterns to their structs

Closes #18367
2024-10-22 12:24:25 +00:00
bors
7cad4da1ab Auto merge of #18368 - Veykril:test-lsif_contains_generated_macros, r=lnicola
tests: Add `lsif_contains_generated_constant` test

Closes https://github.com/rust-lang/rust-analyzer/pull/18309
2024-10-22 12:10:07 +00:00
Jakub Beránek
7c315cfbe6 Switch CI from bors to merge queues 2024-10-22 14:04:24 +02:00
bors
0b906b6e3d Auto merge of #18349 - dqkqd:issue-18344, r=Veykril
feat: render docs from aliased type when type has no docs

Trying to close #18344

- [x] ~Find the docs by traversing upwards if the type itself has none but aliasing for another type that might have.~
- [x] Show docs from aliased type.
- [x] Showing description that we are displaying documentation for different definition in hover box.

![image](https://github.com/user-attachments/assets/820d6f97-aa2c-4dc4-8a25-75746e32d950)
2024-10-22 11:56:16 +00:00
bors
919ba41fee Auto merge of #18371 - Veykril:veykril/push-kwttrusywysp, r=Veykril
fix: Fix incorrect parsing of use bounds

Fixes https://github.com/rust-lang/rust-analyzer/issues/18357
2024-10-22 11:42:11 +00:00
Lukas Wirth
6f71369428 fix: Fix incorrect parsing of use bounds
Also lower them a bit more
2024-10-22 13:34:26 +02:00
Khanh Duong Quoc
b70feec206
feat: render docs from aliased type when docs are missing 2024-10-22 20:27:05 +09:00
Duncan Proctor
273d9d74f9 tidy 2024-10-22 06:54:44 -04:00
Duncan Proctor
734710ff44 tidy 2024-10-22 06:37:12 -04:00
Duncan Proctor
b181cac478 remove duplicate test 2024-10-22 06:25:13 -04:00
Duncan Proctor
21636ac046 resolve range patterns to the their struct types 2024-10-22 06:20:16 -04:00
bors
d4742e7158 Auto merge of #18366 - Veykril:veykril/push-uvwvwzxnkmnz, r=Veykril
Fix status bar message not being marked markdown

Closes https://github.com/rust-lang/rust-analyzer/pull/18323
2024-10-22 09:50:00 +00:00
Lukas Wirth
76368b805d Fix new nightly lints 2024-10-22 11:48:41 +02:00
Johann Hemmann
ec4b9e0901 tests: Add lsif_contains_generated_constant test 2024-10-22 11:38:54 +02:00
Lukas Wirth
5e3561ea06 Cleanup file structure proto handling 2024-10-22 10:51:08 +02:00
Lukas Wirth
3e02349076 Fix status bar messagen not being marked markdown 2024-10-22 10:51:04 +02:00
bors
5087af2bf5 Auto merge of #18362 - duncpro:goto-def-ranges, r=Veykril
feat: goto definition on range operators

Closes #18342
2024-10-22 07:49:18 +00:00
bors
ca51c1e72c Auto merge of #18364 - lnicola:sync-from-rust, r=lnicola
minor: sync from downstream
2024-10-22 07:21:22 +00:00
Duncan Proctor
b763913329 tidy 2024-10-22 03:19:47 -04:00
Laurențiu Nicola
efc2ba2d90 Replace some LayoutError variants with the rustc_abi errors 2024-10-22 10:19:25 +03:00
Laurențiu Nicola
420b665c60 Bump rustc crates 2024-10-22 10:12:46 +03:00
Laurențiu Nicola
5d540f4cc9 Merge from rust-lang/rust 2024-10-22 10:12:22 +03:00
Laurențiu Nicola
5038ee7282 Preparing for merge from rust-lang/rust 2024-10-22 10:12:20 +03:00
Duncan Proctor
88b9b9d5da goto definition on RangeFrom, RangeFull, RangeTo, and RangeToInclusive links to respective struct 2024-10-22 03:11:23 -04:00
bors
1de57a5ce9 Auto merge of #129935 - RalfJung:unsupported_calling_conventions, r=compiler-errors
make unsupported_calling_conventions a hard error

This has been a future-compat lint (not shown in dependencies) since Rust 1.55, released 3 years ago. Hopefully that was enough time so this can be made a hard error now. Given that long timeframe, I think it's justified to skip the "show in dependencies" stage. There were [not many crates hitting this](https://github.com/rust-lang/rust/pull/86231#issuecomment-866300943) even when the lint was originally added.

This should get cratered, and I assume then it needs a t-compiler FCP. (t-compiler because this looks entirely like an implementation oversight -- for the vast majority of ABIs, we already have a hard error, but some were initially missed, and we are finally fixing that.)

Fixes https://github.com/rust-lang/rust/pull/87678
2024-10-22 03:24:40 +00:00
duncanproctor
8e69377c46 Move explicit range handling out of goto_definition, use OperatorClass instead 2024-10-21 20:07:07 -04:00
bors
814df6e50e Auto merge of #131840 - compiler-errors:impossible-maybe, r=lcnr
Dont consider predicates that may hold as impossible in `is_impossible_associated_item`

Use infer vars to account for ambiguities when considering if methods are impossible to instantiate for a given self type. Also while we're at it, let's use the new trait solver instead of `evaluate` since this is used in rustdoc.

r? lcnr
Fixes #131839
2024-10-21 22:58:44 +00:00
bors
4392847410 Auto merge of #131570 - ehuss:update-xcode, r=Mark-Simulacrum
(ci) Update macOS Xcode to 15

This updates the macOS builders to Xcode 15. The aarch64 images will be removing Xcode 14 and 16 very soon (https://github.com/actions/runner-images/issues/10703), so we will need to make the switch to continue operating. The linked issue also documents GitHub's new policy for how they will be updating Xcode in the future. Also worth being aware of is the future plans for x86 runners documented in https://github.com/actions/runner-images/issues/9255 and https://github.com/actions/runner-images/issues/10686, which will impact our future upgrade behaviors.

I decided to also update the Xcode in the x86_64 runners, even though they are not being removed. It felt better to me to have all macOS runners on the same (major) version of Xcode. However, note that the x86_64 runners do not have the latest version of 15 (15.4), so I left them at 15.2 (which is currently the default Xcode of the runner).

Xcode 15 was previously causing problems (see #121058) which seem to be resolved now. `@bjorn3` fixed the `invalid r_symbolnum` issue with cranelift. The issue with clang failing to link seems to be fixed, possibly by the update of the pre-built LLVM from 14 to llvm 15 in https://github.com/rust-lang/rust/pull/124850, or an update in our source version of LLVM. I have run some try builds and at least LLVM seems to build (I did not run any tests).

Closes #121058
2024-10-21 20:19:06 +00:00