rust/tests
bors bcfea1f8d2 Auto merge of #133194 - khuey:master, r=jieyouxu
Drop debug info instead of panicking if we exceed LLVM's capability to represent it

Recapping a bit of history here:

In #128861 I made debug info correctly represent parameters to inline functions by removing a fake lexical block that had been inserted to suppress LLVM assertions and by deduplicating those parameters.

LLVM, however, expects to see a single parameter _with distinct locations_, particularly distinct inlinedAt values on the DILocations. This generally worked because no matter how deep the chain of inlines it takes two different call sites in the original function to result in the same function being present multiple times, and a function call requires a non-zero number of characters, but macros threw a wrench in that in #131944. At the time I thought the issue there was limited to proc-macros, where an arbitrary amount of code can be generated at a single point in the source text.

In #132613 I added discriminators to DILocations that would otherwise be the same to repair #131944[^1]. This works, but LLVM's capacity for discriminators is not infinite (LLVM actually only allocates 12 bits for this internally). At the time I thought it would be very rare for anyone to hit the limit, but #132900 proved me wrong. In the relatively-minimized test case it also became clear to me that the issue affects regular macros too, because the call to the inlined function will (without collapse_debuginfo on the macro) be attributed to the (repeated, if the macro is used more than once) textual callsite in the macro definition.

This PR fixes the panic by dropping debug info when we exceed LLVM's maximum discriminator value. There's also a preceding commit for a related but distinct issue: macros that use collapse_debuginfo should in fact have their inlinedAts collapsed to the macro callsite and thus not need discriminators at all (and not panic/warn accordingly when the discriminator limit is exhausted).

Fixes #132900

r? `@jieyouxu`

[^1]: Editor's note: `fix` is a magic keyword in PR description that apparently will close the linked issue (it's closed already in this case, but still).
2024-11-20 02:10:50 +00:00
..
assembly tests: use max-llvm-major-version instead of ignore-llvm-version range like N - 99 2024-11-14 17:44:54 +08:00
auxiliary Fix typo in tests/auxiliary/minicore.rs 2024-11-03 17:32:33 +09:00
codegen Likely unlikely fix 2024-11-17 21:49:10 +01:00
codegen-units
coverage coverage: Restrict empty-span expansion to only cover { and } 2024-11-08 20:43:08 +11:00
coverage-run-rustdoc coverage: Restrict empty-span expansion to only cover { and } 2024-11-08 20:43:08 +11:00
crashes Auto merge of #133205 - matthiaskrgr:rollup-xhhhp5u, r=matthiaskrgr 2024-11-19 16:31:58 +00:00
debuginfo Mark numeric-types.rs as 64-bit only for now 2024-11-17 04:16:59 +08:00
incremental fixup some test directives 2024-11-17 22:15:54 +00:00
mir-opt Likely unlikely fix 2024-11-17 21:49:10 +01:00
pretty Add pretty, ui, and feature-gate tests for the enzyme/autodiff frontend 2024-10-11 20:38:43 +02:00
run-make Auto merge of #132646 - jieyouxu:liberate-aarch64-gnu-debug, r=Kobzol 2024-11-17 20:51:52 +00:00
rustdoc Add regression test for jump to def links on items with generics 2024-11-18 18:11:50 +01:00
rustdoc-gui rustdoc-search: simplify rules for generics and type params 2024-10-30 12:27:48 -07:00
rustdoc-js rustdoc-search: add standalone trailing :: test 2024-11-17 08:07:16 -07:00
rustdoc-js-std rustdoc search: allow queries to end in an empty path segment 2024-11-15 16:32:40 -06:00
rustdoc-json Rename Receiver -> LegacyReceiver 2024-10-22 12:55:16 +00:00
rustdoc-ui Auto merge of #126597 - estebank:unicode-output, r=fmease 2024-11-11 00:00:58 +00:00
ui Auto merge of #133194 - khuey:master, r=jieyouxu 2024-11-20 02:10:50 +00:00
ui-fulldeps Likely unlikely fix 2024-11-17 21:49:10 +01:00
COMPILER_TESTS.md