rust/tests
Stuart Cook 17c25e4483
Rollup merge of #148872 - ShoyuVanilla:issue-148192, r=chenyukang
fix: Do not ICE when missing match arm with ill-formed subty is met

Fixes rust-lang/rust#148192

The ICE comes from the following line, calling `normalize_erasing_regions` to a projection type whose trait bound is not met:
2fcbda6c1a/compiler/rustc_pattern_analysis/src/rustc.rs (L185-L194)

The above function is called while trying to lint missing match arms, or scrutinize ctors of missing(not necessary error) match arms.

So, the following code can trigger ICEs.
```rust
trait WhereTrait {
    type Type;
}

fn foo(e: Enum) {
    match e {
        Enum::Map(_) => (), // ICE, while trying to lint missing arms
    }

    if let Enum::Map(_) = e {} // ICE, while trying to scrutinize missing ctors (even worse)
}

enum Enum {
    Map(()),
    Map2(<() as WhereTrait>::Type),
}
```

This ICE won't be triggered with the following code, as this is filtered out before `check_match` as the existence of ill-formed type inside the variant marks the body as tainted by error in `hir_typeck`, but for the above code, the `hir_typeck` complains nothing because everything it sees is locally correct.

```rust
fn foo(e: Enum) {
    match e {
        Enum::Map2(_) => (), // No ICE
    }
}
```

I've considered visiting and wf checking for the match scrutinee before entering `check_match`, but that might regress the perf and I think just emitting delayed bug would enough as the normalization failure would be originated by other errors like ill-formdness.
2025-11-13 11:57:10 +11:00
..
assembly-llvm stabilize s390x_target_feature_vector 2025-11-06 12:49:48 +01:00
auxiliary Rollup merge of #147355 - sayantn:masked-loads, r=RalfJung,bjorn3 2025-11-05 10:59:18 +11:00
codegen-llvm Update tests/codegen-llvm/deduced-param-attrs.rs 2025-11-11 12:31:37 +03: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 Adjust spans into the for loops context before creating the pattern and into_iter call spans. 2025-11-11 19:18:19 -05:00
coverage-run-rustdoc
crashes Check that impls of #[type_const] consts also have the attr 2025-11-08 23:05:08 -05:00
debuginfo Minor fixes to StdNonZeroNumberProvider for gdb 2025-11-05 11:42:54 -07:00
incremental Add a note when a type implements a trait with the same name as the required one 2025-11-11 17:36:43 +01:00
mir-opt fix filecheck typos in tests 2025-11-10 17:55:01 +03:00
pretty Rollup merge of #143619 - beetrees:varargs-named, r=jdonszelmann 2025-11-11 21:09:33 +11:00
run-make Auto merge of #144674 - rperier:add_note_if_a_type_impl_a_trait_with_the_same_name, r=lcnr 2025-11-11 21:54:08 +00:00
run-make-cargo Skip the panic-immediate-abort-works test when cross-compiling 2025-09-22 21:13:38 -04:00
rustdoc Update jump to def macro link generation test 2025-11-11 17:41:17 +01:00
rustdoc-gui rustdoc-search: add test case for throbber 2025-10-07 12:59:58 -07:00
rustdoc-js Rollup merge of #147701 - lolbinarycat:rustdoc-search-alias-fix, r=GuillaumeGomez 2025-11-13 11:57:07 +11:00
rustdoc-js-std Add regression test for including derive macros in macro filtering 2025-10-27 16:00:32 +01:00
rustdoc-json Add tests for doc(attribute = "...") attribute 2025-08-28 15:56:30 +02:00
rustdoc-ui Rollup merge of #146495 - fmease:rustdoc-erase-doc-priv-items-attr, r=GuillaumeGomez 2025-11-11 21:09:33 +11:00
ui Rollup merge of #148872 - ShoyuVanilla:issue-148192, r=chenyukang 2025-11-13 11:57:10 +11:00
ui-fulldeps When more than a single impl and less than 4 could apply, point at them 2025-10-31 20:44:01 +00:00
COMPILER_TESTS.md