rust/tests
bors 36e4f5d1fe Auto merge of #146096 - adwinwhite:handle_normalization_overflow_in_mono1, r=saethlin
Fix normalization overflow ICEs in monomorphization

Fixes rust-lang/rust#92004
Fixes rust-lang/rust#92470
Fixes rust-lang/rust#95134
Fixes rust-lang/rust#105275
Fixes rust-lang/rust#105937
Fixes rust-lang/rust#117696-2
Fixes rust-lang/rust#118590
Fixes rust-lang/rust#122823
Fixes rust-lang/rust#131342
Fixes rust-lang/rust#139659

## Analysis:
The causes of these issues are similar. They contain generic recursive functions that can be instantiated with different args infinitely at monomorphization stage.
Ideally this should be caught by the [`check_recursion_limit`](c0bb3b98bb/compiler/rustc_monomorphize/src/collector.rs (L468)) function. The reality is that normalization can reach recursion limit earlier than monomorphization's check because they calculate depths in different ways.
Since normalization is called everywhere, ICEs appear in different locations.

## Fix:
If we abort on overflow with `TypingMode::PostAnalysis` in the trait solver, it would also catch these errors.
The main challenge is providing good diagnostics for them. So it's quite natural to put the check right before these normalization happening.
I first tried to check the whole MIR body's normalization and `references_error`. (As elaborate_drop handles normalization failure by [returning `ty::Error`](c0bb3b98bb/compiler/rustc_mir_transform/src/elaborate_drop.rs (L514-L519)).)
It turns out that checking all `Local`s seems sufficient.
These types are gonna be normalized anyway. So with cache, these checks shouldn't be expensive.

This fixes these ICEs for both the next and old solver, though I'm not sure the change I made to the old solver is proper. Its overflow handling looks convoluted thus I didn't try to fix it more "upstream".
2025-10-13 00:20:10 +00:00
..
assembly-llvm x86_64-bigint-helpers test: update test assertion 2025-10-09 12:28:06 +00:00
auxiliary Add test for addrspacecasting global vars 2025-09-03 08:40:51 +02:00
codegen-llvm Rollup merge of #147457 - the8472:slice_fill_memset2, r=RalfJung,joboet 2025-10-09 18:43:22 +11:00
codegen-units pub async fn implementation coroutine (func::{closure#0}) is monomorphized, when func itself is monomorphized 2025-09-01 13:45:00 +07:00
coverage Auto merge of #145882 - m-ou-se:format-args-extend-1-arg, r=petrochenkov 2025-09-26 04:34:09 +00:00
coverage-run-rustdoc
crashes Auto merge of #146096 - adwinwhite:handle_normalization_overflow_in_mono1, r=saethlin 2025-10-13 00:20:10 +00:00
debuginfo codegen: Generate dbg_value for the ref statement 2025-10-02 14:55:51 +08:00
incremental
mir-opt Auto merge of #145513 - beepster4096:erasedereftemps, r=saethlin,cjgillot 2025-10-12 02:34:20 +00:00
pretty Update autodiff tests for the new intrinsics impl 2025-08-14 18:33:43 +00:00
run-make Set the minimum deployment target for aarch64-apple-watchos 2025-10-07 17:21:24 +02:00
run-make-cargo Skip the panic-immediate-abort-works test when cross-compiling 2025-09-22 21:13:38 -04:00
rustdoc Add regression test for doc cfg applied on public items inside private items 2025-09-29 18:08:51 +02:00
rustdoc-gui rustdoc-search: add test case for throbber 2025-10-07 12:59:58 -07:00
rustdoc-js rustdoc: add testcase for traitParent deduplication 2025-10-02 15:29:22 -05:00
rustdoc-js-std fix rustdoc tests broke by trait item filtering 2025-10-02 15:28:00 -05:00
rustdoc-json Add tests for doc(attribute = "...") attribute 2025-08-28 15:56:30 +02:00
rustdoc-ui Improve missing create level error message 2025-10-08 11:35:20 +01:00
ui Auto merge of #146096 - adwinwhite:handle_normalization_overflow_in_mono1, r=saethlin 2025-10-13 00:20:10 +00:00
ui-fulldeps use declarative macro for #[derive(TryFromU32)] 2025-10-06 14:54:38 +00:00
COMPILER_TESTS.md