Commit Graph

28170 Commits

Author SHA1 Message Date
bors
4b33850c39 Auto merge of #16951 - lnicola:provenance-split-comment, r=lnicola
minor: Update comment on provenance_split

Hope I got this right `@dfireBird.`
2024-03-26 09:00:24 +00:00
Laurențiu Nicola
85947bba49 Update comment on provenance_split 2024-03-26 10:58:35 +02:00
bors
0583aaa555 Auto merge of #16805 - dfireBird:lifetime_lowering, r=Veykril
feat: Implement resolving and lowering of Lifetimes (no inference yet)
2024-03-26 07:58:43 +00:00
dfireBird
0e54e2b55a
use references in Generics iter methods 2024-03-26 13:04:54 +05:30
bors
e52bb8cddb Auto merge of #16906 - Young-Flash:limit_struct_hover_display, r=Veykril
feat: limit struct hover display nums

follow up https://github.com/rust-lang/rust-analyzer/pull/15847, https://github.com/rust-lang/rust-analyzer/pull/15938
2024-03-25 22:13:59 +00:00
bors
9b79fa2393 Auto merge of #16930 - lnicola:dist-malloc, r=Veykril
internal: Support choosing the allocator in `xtask dist`
2024-03-25 22:01:23 +00:00
bors
dacfa72f85 Auto merge of #16944 - Nadrieril:update-pat-ana, r=lnicola
Revert to the crates.io version of rustc_pattern_analysis

The API hasn't fully settled yet, and there's an extra wrinkle with `IdxContainer` which blocked the [subtree update](https://github.com/rust-lang/rust/pull/122981). Let's just keep using the crates.io version for a bit longer.

r? `@lnicola`
2024-03-25 12:17:18 +00:00
Nadrieril
1716cc8433 Revert to the crates.io version of rustc_pattern_analysis 2024-03-25 13:09:37 +01:00
Young-Flash
58013ad70d add test for struct field hover display limit 2024-03-25 19:55:19 +08:00
Young-Flash
ba8c9810aa review update 2024-03-25 19:55:19 +08:00
Young-Flash
a89e417ce5 adjust test 2024-03-25 19:55:19 +08:00
Young-Flash
1c85234bcd limit struct field hover display nums 2024-03-25 19:55:19 +08:00
Young-Flash
d81148a009 expose config for hover struct field display 2024-03-25 19:55:19 +08:00
bors
6f6b03f9de Auto merge of #16935 - Nilstrieb:dont-panic, r=HKalbasi
Handle panicking like rustc CTFE does

Instead of using `core::fmt::format` to format panic messages, which may in turn panic too and cause recursive panics and other messy things, redirect `panic_fmt` to `const_panic_fmt` like CTFE, which in turn goes to `panic_display` and does the things normally. See the tests for the full call stack.

The tests don't work yet, I probably missed something in minicore.

fixes #16907 in my local testing, I also need to add a test for it
2024-03-24 18:17:36 +00:00
bors
3dfd4c1f4c Auto merge of #16915 - 6d7a:master, r=HKalbasi
fix: Prevent stack overflow in recursive const types

In the evaluation of const values of recursive types certain declarations could cause an endless call-loop within the interpreter (hir-ty’s create_memory_map), which would lead to a stack overflow.
This commit adds a check that prevents values that contain an address in their value (such as TyKind::Ref) from being allocated at the address they contain.
The commit also adds a test for this edge case.
2024-03-24 15:05:14 +00:00
Nilstrieb
2dfe7de8b6 Handle panicking like rustc CTFE does
Instead of using `core::fmt::format` to format panic messages, which may in turn
panic too and cause recursive panics and other messy things, redirect
`panic_fmt` to `const_panic_fmt` like CTFE, which in turn goes to
`panic_display` and does the things normally. See the tests for the full
call stack.
2024-03-24 15:40:26 +01:00
6d7a
142ef764ee fix: Check stack depth to prevent stack overflows in create_memory_map 2024-03-24 10:19:25 +01:00
Laurențiu Nicola
f6b9cff105 Support choosing the allocator in xtask dist 2024-03-23 11:48:21 +02:00
Laurențiu Nicola
84d38c7e94 Move xtask flags around outide the generated section 2024-03-23 11:35:32 +02:00
bors
e265e3d518 Auto merge of #16929 - lnicola:bump-release-actions, r=lnicola
internal: Bump release actions and Node
2024-03-23 08:09:18 +00:00
Laurențiu Nicola
869efe23c0 Bump actions/checkout, actions/setup-node and node in release workflow 2024-03-23 09:54:50 +02:00
bors
903158268a Auto merge of #16928 - lnicola:rocky-8, r=lnicola
internal: Build x86_64-unknown-linux-gnu releases on Rocky Linux 8
2024-03-23 07:37:54 +00:00
Laurențiu Nicola
6ee3f66386 Build x86_64-unknown-linux-gnu on Rocky Linux 8 2024-03-23 08:48:31 +02:00
bors
6e54d41d5a Auto merge of #16927 - Sculas:fix/funclike-rename, r=Veykril
fix: Rename `func_like` to `FuncLike`

Should fix #16926. Please check the issue for more information.
2024-03-23 05:39:28 +00:00
Sculas
966d387afa
fix: Rename func_like to FuncLike
Fixes rust-lang/rust-analyzer#16926
2024-03-22 23:03:44 +01:00
bors
6f54ebb30c Auto merge of #16905 - Veykril:sysroot-patch-cfg, r=Veykril
internal: Rename ProcMacroKind::FuncLike to Bang
2024-03-22 10:22:43 +00:00
Lukas Wirth
8e324e98a1 Rename ProcMacroKind::FuncLike to Bang 2024-03-22 11:20:56 +01:00
bors
fc0d51ae65 Auto merge of #16919 - roife:fix-issue-16800, r=Veykril
fix: handle self::super when lowering UseTree

fix #16800.
2024-03-22 07:45:50 +00:00
roife
0e8170e846 fix: handle self::super in lowering of UseTree 2024-03-22 15:36:00 +08:00
bors
5577612fd0 Auto merge of #16918 - Veykril:utf8-paths, r=Veykril
fix: Don't assert paths being utf8 when filtering them in the watcher

Closes https://github.com/rust-lang/rust-analyzer/issues/16914
2024-03-22 07:06:13 +00:00
Lukas Wirth
ea447062c4 fix: Don't assert paths being utf8 when filtering them in the watcher 2024-03-22 08:04:50 +01:00
6d7a
7c1be82cd9 fix: Prevent stack overflow in recursive const types
In the evaluation of const values of recursive types
certain declarations could cause an endless call-loop
within the interpreter (hir-ty’s create_memory_map),
which would lead to a stack overflow.
This commit adds a check that prevents values that contain
an address in their value (such as TyKind::Ref) from being
allocated at the address they contain.
The commit also adds a test for this edge case.
2024-03-21 22:57:21 +01:00
bors
7ef7f442fc Auto merge of #16913 - Veykril:client-watched-files, r=Veykril
fix: Some file watching related vfs fixes

Fixes https://github.com/rust-lang/rust-analyzer/issues/15554, additionally it seems that client side file watching was broken on windows this entire time, this PR switches `DidChangeWatchedFilesRegistrationOptions` to use relative glob patterns which do work on windows in VSCode.
2024-03-21 20:29:02 +00:00
Lukas Wirth
fe28e470cd Use relative glob patterns in DidChangeWatchedFilesRegistrationOptions 2024-03-21 21:27:34 +01:00
Lukas Wirth
23613a9de7 fix: Some file watching related vfs fixes 2024-03-21 21:22:19 +01:00
bors
4d442d84d7 Auto merge of #16912 - Veykril:span-trait, r=Veykril
internal: Remove span trait
2024-03-21 19:11:12 +00:00
Lukas Wirth
cd8eb0fe6d internal: Remove span trait 2024-03-21 20:08:30 +01:00
bors
16c8deeb86 Auto merge of #16835 - wyatt-herkamp:use_one_tt_for_a_derive, r=Veykril
Have Derive Attribute share a token tree with it's proc macros.

The goal of this PR is to stop creating a token tree for each derive proc macro.

This is done by giving the derive proc macros an id to its parent derive element.

From running the analysis stat on the rust analyzer project I did see a small memory decrease.

```
Inference:           42.80s, 362ginstr, 591mb
MIR lowering:        8.67s, 67ginstr, 291mb
Mir failed bodies: 18 (0%)
Data layouts:        85.81ms, 609minstr, 8mb
Failed data layouts: 135 (6%)
Const evaluation:    440.57ms, 5235minstr, 13mb
Failed const evals: 1 (0%)
Total:               64.16s, 552ginstr, 1731mb
```
After Change
```
Inference:           40.32s, 340ginstr, 593mb
MIR lowering:        7.95s, 62ginstr, 292mb
Mir failed bodies: 18 (0%)
Data layouts:        87.97ms, 591minstr, 8mb
Failed data layouts: 135 (6%)
Const evaluation:    433.38ms, 5226minstr, 14mb
Failed const evals: 1 (0%)
Total:               60.49s, 523ginstr, 1680mb
```

Currently this breaks the expansion for the actual derive attribute.

## TODO
- [x] Pick a better name for the function `smart_macro_arg`
2024-03-21 18:04:38 +00:00
Wyatt Herkamp
c381d0fc64 Review Updates 2024-03-21 13:41:46 -04:00
Wyatt Herkamp
262e06f1ef Remove MacroCallKind::DeriveAttr 2024-03-21 12:50:58 -04:00
bors
a3d96253a9 Auto merge of #16911 - Veykril:rustc-crates, r=Veykril
fix: Fix projects depending on `rustc_private` hanging

If loading the root fails, we'll hang up in this loop as we never inserted the entry that asserts we already visited a package. This fixes that
Fixes https://github.com/rust-lang/rust-analyzer/issues/16902
2024-03-21 15:58:27 +00:00
Lukas Wirth
2ad14b8069 fix: Fix projects depending on rustc_private hanging 2024-03-21 16:55:42 +01:00
bors
20290b2992 Auto merge of #16909 - Veykril:spans, r=Veykril
fix: Keep the span for `Attr::Literal` around
2024-03-21 15:04:17 +00:00
Wyatt Herkamp
c376addfcc Cleanup 2024-03-21 08:12:26 -04:00
Wyatt Herkamp
70f5344deb macro_arg_considering_derives is now in ExpandDatabase and now takes in the MacroCallKind 2024-03-21 08:07:54 -04:00
Wyatt Herkamp
2c2bbe07fd Treat Derive Macro specially. 2024-03-21 08:07:54 -04:00
Wyatt Herkamp
4bd2f948bb Formatting 2024-03-21 08:07:54 -04:00
Wyatt Herkamp
f499564d0a censor attribute derive 2024-03-21 08:06:43 -04:00
Wyatt Herkamp
15d183be79 Initial Attempt limiting number of token tree in macro expansion. 2024-03-21 08:06:43 -04:00
bors
83f9cc677f Auto merge of #16895 - Veykril:spans, r=Veykril
Resolve whether `$pat` is `$pat_param` or not via 🌟hygiene🌟

Before we just picked the edition from the macro def which is wrong, since a macro call can produce the fragment kind from a different definition site.
2024-03-21 11:04:41 +00:00