33168 Commits

Author SHA1 Message Date
boattime
41687437af feat: Add dereferencing autocomplete 2025-01-13 17:00:49 -08:00
bors
8dbbb597f3 Auto merge of #135192 - jdupak-ms:cdb-tests, r=wesleywiser
Add and improve debuginfo tests for Windows

Adds new test for closures and function pointers.
Improves robustness of existing tests by sorting wildcard matched outputs.

try-job: i686-msvc
2025-01-13 18:13:53 +00:00
Chayim Refael Friedman
8ab18927ce Fix another bug when reaching macro expansion limit caused a stack overflow
This time without missing bindings.

Solve it by returning to the old ways, i.e. just throw the extra nodes away.

In other words, I acknowledge defeat.
2025-01-13 15:55:30 +02:00
bors
886afc40ff Auto merge of #135167 - mzacho:depth-limit-const-eval-query, r=oli-obk
Depth limit const eval query

Currently the const-eval query doesn't have a recursion limit or timeout, causing the complier to freeze in an infinite loop, see #125718. This PR depth limits the `eval_to_const_value_raw` query (with the [`recursion_limit`](https://doc.rust-lang.org/reference/attributes/limits.html) attribute) and improves the diagnostics for query overflow errors, so spans are reported for other dep kinds than `layout_of` (e.g. `eval_to_const_value_raw`).

fixes #125718
fixes #114192
2025-01-13 10:18:26 +00:00
Lukas Wirth
8364ef2997
Merge pull request #18923 from Veykril/push-oovkowowotqx
internal: Compute inlay hint tooltips lazily
2025-01-13
2025-01-12 13:57:11 +00:00
Lukas Wirth
f66bbbf27d internal: Compute inlay hint tooltips lazily 2025-01-12 14:42:44 +01:00
Lukas Wirth
69ab0cfb48
Merge pull request #18921 from Veykril/push-zwullmxomvsm
internal: Compute inlay hint text edits lazily
2025-01-12 13:20:33 +00:00
Lukas Wirth
0f595b07bd Fix text edits for discriminant hints 2025-01-12 14:04:35 +01:00
Lukas Wirth
f43a37ad25 internal: Compute inlay hint text edits lazily 2025-01-12 14:00:37 +01:00
Lukas Wirth
1485a8819f
Merge pull request #18920 from Veykril/push-zxwtmooxumsl
fix: Fix `ref` text edit for binding mode hints
2025-01-12 12:28:57 +00:00
Lukas Wirth
720e727a9d fix: Fix ref text edit for binding mode hints 2025-01-12 13:14:00 +01:00
bors
b5c1d918ed Auto merge of #135292 - lqd:rustcperfup, r=kobzol
bump `rustc-perf` submodule

This updates the `rustc-perf` submodule to pull in the recent changes, in particular the error handling in https://github.com/rust-lang/rustc-perf/pull/2021 fixing the error we saw in a recent run.

I think I did this correctly, submodules are so annoying.

r? kobzol

(opening as draft to do a perf run and check that nothing has changed indeed)
2025-01-11 11:54:26 +00:00
bors
d8c92dc0ab Auto merge of #135274 - saethlin:array-repeats, r=compiler-errors
Add an InstSimplify for repetitive array expressions

I noticed in https://github.com/rust-lang/rust/pull/135068#issuecomment-2569955426 that GVN's implementation of this same transform was quite profitable on the deep-vector benchmark. But of course GVN doesn't run in unoptimized builds, so this is my attempt to write a version of this transform that benefits the deep-vector case and is fast enough to run in InstSimplify.

The benchmark suite indicates that this is effective.
2025-01-11 06:33:55 +00:00
Laurențiu Nicola
9923b0085c
Merge pull request #18913 from Wilfred/grammar_fix
minor: Fix grammar in doc comments
2025-01-11 06:19:03 +00:00
bors
157a81d6ce Auto merge of #135258 - oli-obk:push-ktzskvxuwnlt, r=saethlin
Use llvm.memset.p0i8.* to initialize all same-bytes arrays

Similar to #43488

debug builds can now handle `0x0101_u16` and other multi-byte scalars that have all the same bytes (instead of special casing just `0`)
2025-01-11 03:40:38 +00:00
Wilfred Hughes
7f6b8745c8 minor: Fix grammar in doc comments
"too" should be "to" here.
2025-01-10 17:38:14 -08:00
Lukas Wirth
4f35021ca9
Merge pull request #18907 from Veykril/push-uqlzpttmvurv
Implement `#[rust_analyzer::skip]` for bodies
2025-01-10 13:59:23 +00:00
Lukas Wirth
f209d50dcf Implement #[rust_analyzer::skip] for bodies 2025-01-10 14:41:27 +01:00
Lukas Wirth
e8ad0c03e8
Merge pull request #18906 from Veykril/push-upuxsyovskmt
feat: Re-implement rust string highlighting via tool attribute
2025-01-10 13:38:43 +00:00
jnyfah
11717ca5d4 Missing errors 2025-01-10 14:22:00 +01:00
Lukas Wirth
bf669dab84 Re-implement rust string highlighting via tool attribute 2025-01-10 13:49:35 +01:00
Lukas Wirth
897f7e579e
Merge pull request #18904 from Veykril/push-yztnorquuyzw
Improve hover module path rendering
2025-01-10 11:53:38 +00:00
Lukas Wirth
67fd72d5ee
Merge pull request #18903 from Veykril/push-mqmworppxuyw
Implement implicit sized bound inlay hints
2025-01-10 11:53:18 +00:00
Lukas Wirth
d4fa92e80a Implement implicit sized bound inlay hints 2025-01-10 12:38:21 +01:00
Lukas Wirth
3bae1f0a1b Improve hover module path rendering 2025-01-10 12:36:55 +01:00
Lukas Wirth
1b52a6680f
Merge pull request #18900 from ChayimFriedman2/stupid-hang
fix: Do not compute `prettify_macro_expansion()` unless the "Inline macro" assist has actually been invoked
2025-01-10 11:02:54 +00:00
Lukas Wirth
6f04f373d7
Merge pull request #18902 from Veykril/push-znlsxykqrkoo
internal: Add Definition::Crate
2025-01-10 10:01:43 +00:00
Lukas Wirth
e6270bd378 internal: Add Definition::Crate
This is its own thing so it should be handled specifically where possible
2025-01-10 10:45:44 +01:00
bors
25eb5662cd Auto merge of #135273 - dianne:argument-patterns-are-not-boring, r=lqd
Remove special-casing for argument patterns in MIR typeck (attempt to fix perf regression of  #133858)

See [my comment](https://github.com/rust-lang/rust/pull/133858#issuecomment-2579029618) on #133858 for more information. This is just a guess as to what went wrong, and I haven't been able to get the profiler running locally, so I'll need a perf run to make sure this actually helps.

There's one test's stderr that suffers a bit, but this was just papering over the issue anyway. Making region errors point to the correct constraints in the presence of invariance/contravariance is a broader problem; the current way it's handled is mostly based on guesswork, luck, and hoping it works out. Properly handling that (somehow) would improve the test's stderr without the hack that this PR reverts.
2025-01-10 08:53:21 +00:00
Lukas Wirth
89b37675d7
Merge pull request #18901 from ChayimFriedman2/hir-reexport
minor: Remove two hir reexports
2025-01-10 06:57:18 +00:00
Lukas Wirth
d133136bc4
Merge pull request #18813 from Giga-Bowser/syntax-tree-view
feat: Add a new and improved syntax tree view
2025-01-10 06:56:34 +00:00
Lukas Wirth
b75a96915e
Merge pull request #18899 from ChayimFriedman2/issue-18898
fix: Fix another issue with fixup reversing
2025-01-10 06:55:45 +00:00
bors
41ca9b7b22 Auto merge of #135319 - matthiaskrgr:rollup-un5lol6, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #133088 (`-Zrandomize-layout` harder. `Foo<T> != Foo<U>`)
 - #134619 (Improve prose around `as_slice` example of IterMut)
 - #134855 (Add `default_field_values` entry to unstable book)
 - #134908 (Fix `ptr::from_ref` documentation example comment)
 - #135275 (Add Pin::as_deref_mut to 1.84 relnotes)
 - #135294 (Make `bare-fn-no-impl-fn-ptr-99875` test less dependent on path width)
 - #135304 (Add tests cases from review of #132289)
 - #135308 (Make sure to walk into nested const blocks in `RegionResolutionVisitor`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-10 06:05:05 +00:00
Matthias Krüger
ef67bf2e49
Rollup merge of #135308 - compiler-errors:scope-visit, r=oli-obk
Make sure to walk into nested const blocks in `RegionResolutionVisitor`

Fixes https://github.com/rust-lang/rust/issues/135306

I tried auditing the rest of the visitors that called `.visit_body`, and it seems like this is the only one that was missing it. I wonder if we should modify intravisit (specifcially, that `NestedBodyFilter` stuff) to make this less likely to happen, tho...

r? oli-obk
2025-01-10 06:28:42 +01:00
Matthias Krüger
484c3b4de8
Rollup merge of #135304 - steffahn:tests_from_132289, r=compiler-errors
Add tests cases from review of #132289

Adding my comments as test-cases as suggested by ``@jackh726`` in https://github.com/rust-lang/rust/pull/132289#issuecomment-2564602267
2025-01-10 06:28:41 +01:00
Matthias Krüger
2fb0a15b29
Rollup merge of #135294 - ChrisDenton:bare-fn-width, r=jieyouxu
Make `bare-fn-no-impl-fn-ptr-99875` test less dependent on path width

This sets diagnostic-width to some arbitrary number. Seems to work on my machine.
2025-01-10 06:28:41 +01:00
Matthias Krüger
b08e5e3e71
Rollup merge of #135275 - coolreader18:pin-as_deref_mut-relnotes, r=BoxyUwU
Add Pin::as_deref_mut to 1.84 relnotes

Resolves #131243 - I think this got missed in the relnotes sweep or something.

``@rustbot`` label relnotes
2025-01-10 06:28:40 +01:00
Matthias Krüger
70772b7543
Rollup merge of #134908 - madsmtm:ptr-from_ref-docs, r=ibraheemdev
Fix `ptr::from_ref` documentation example comment

The comment says that the expression involves no function call, but that was only true for the example above, the example here _does_ contain a function call.

``@rustbot`` label A-docs
2025-01-10 06:28:39 +01:00
Matthias Krüger
620adf2ee0
Rollup merge of #134855 - estebank:default-field-values-unstable-docs, r=jieyouxu
Add `default_field_values` entry to unstable book

Tracking issue: https://github.com/rust-lang/rust/issues/132162
RFC: https://github.com/rust-lang/rfcs/blob/master/text/3681-default-field-values.md
2025-01-10 06:28:39 +01:00
Matthias Krüger
71e4f060fc
Rollup merge of #134619 - hkBst:patch-7, r=jhpratt
Improve prose around `as_slice` example of IterMut

I've removed the cryptic message about not being able to call `&mut self` methods while retaining a shared borrow of the iterator, such as `as_slice` produces. This is just normal borrowing rules and does not seem especially relevant here. I can whip up a replacement if someone thinks it has value.
2025-01-10 06:28:38 +01:00
Matthias Krüger
42d386f559
Rollup merge of #133088 - the8472:randomize-me-harder, r=workingjubilee
`-Zrandomize-layout` harder. `Foo<T> != Foo<U>`

Tracking issue: #106764

Previously randomize-layout only used a deterministic shuffle based on the seed stored in an Adt's ReprOptions, meaning that `Foo<T>`  and `Foo<U>` were shuffled by the same seed. This change adds a similar seed to each calculated LayoutData so that a struct can be randomized both based on the layout of its fields and its per-type seed.
Primitives start with simple seed derived from some of their properties. Though some types can no longer be distinguished at that point, e.g. usize and u64 will still be treated the same.
2025-01-10 06:28:37 +01:00
The 8472
7b368b97ba also initialize Layout field in rust-analyzer 2025-01-10 02:22:57 +01:00
Chayim Refael Friedman
87f7a5849c Remove two hir reexports 2025-01-10 03:19:28 +02:00
Chayim Refael Friedman
52794d5194 Do not compute prettify_macro_expansion() unless the "Inline macro" assist has actually been invoked
And not just called to be listed.

This was a major performance hang when repeatedly switching back-and-forth between a large `include!`d file (but there are others)..
2025-01-10 00:56:00 +02:00
Giga Bowser
c0f22c7e9d Add an action to copy an element from the syntax tree view 2025-01-09 14:03:18 -06:00
Chayim Refael Friedman
bbcb71a403 Fix another issue with fixup reversing
We need to *remove* the whole subtree, but we don't advance `i` by this, because it hasn't gotten there yet (and never will).
2025-01-09 22:02:44 +02:00
Giga Bowser
cb5ce9eaa6 Remove the old syntax tree viewer 2025-01-09 13:20:06 -06:00
Giga Bowser
5ffe45d8cd Add a new and improved syntax tree viewer 2025-01-09 13:20:06 -06:00
duncan
04c06b4c5a Fix parsing cargo test json output by making stdout and optional field 2025-01-09 16:01:08 +00:00
Lukas Wirth
cc016df54b
Merge pull request #18889 from ChayimFriedman2/subtle-completion
fix: Fix actual token lookup in completion's `expand()`
2025-01-09 12:12:38 +00:00