rust/compiler/rustc_hir_analysis/src
bors faefc618cf Auto merge of #124219 - gurry:122989-ice-unexpected-anon-const, r=compiler-errors
Do not ICE on `AnonConst`s in `diagnostic_hir_wf_check`

Fixes #122989

Below is the snippet from #122989 that ICEs:
```rust
trait Traitor<const N: N<2> = 1, const N: N<2> = N> {
    fn N(&N) -> N<2> {
        M
    }
}

trait N<const N: Traitor<2> = 12> {}
```

The `AnonConst` that triggers the ICE is the `2` in the param `const N: N<2> = 1`. The currently existing code in `diagnostic_hir_wf_check` deals only with `AnonConst`s that are default values of some param, but  the `2` is not a default value. It is just an `AnonConst` HIR node inside a `TraitRef` HIR node corresponding to `N<2>`. Therefore the existing code cannot handle it and this PR ensures that it does.
2024-05-07 20:01:18 +00:00
..
check Inline & delete Ty::new_unit, since it's just a field access 2024-05-02 17:49:23 +02:00
coherence shallow resolve in orphan check 2024-05-02 15:44:05 +00:00
collect Avoid some def_span query calls 2024-04-29 09:48:19 +00:00
errors Explicitly mention Self 2024-04-20 11:39:43 -04:00
hir_ty_lowering Inline & delete Ty::new_unit, since it's just a field access 2024-05-02 17:49:23 +02:00
impl_wf_check Use expand_weak_alias_tys when collecting constrained generics params in impls 2024-02-20 17:31:59 +01:00
outlives Use FxIndexMap instead of BTreeMap to avoid sorting DefIds 2024-03-27 14:02:15 +00:00
structured_errors Suggest _ for missing generic arguments in turbofish 2024-03-17 17:34:17 +00:00
variance Don't leak unnameable types in -> _ recover 2024-04-14 11:43:05 -04:00
autoderef.rs Take ocx by move for pending obligations 2024-05-02 22:03:01 -04:00
bounds.rs Make Bounds.clauses private 2024-05-04 10:20:39 +08:00
check_unused.rs Rename TyCtxt::struct_span_lint_hir as TyCtxt::node_span_lint. 2024-01-23 08:09:01 +11:00
collect.rs Auto merge of #124401 - oli-obk:some_hir_cleanups, r=cjgillot 2024-05-04 00:32:27 +00:00
constrained_generic_params.rs Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00
errors.rs Auto merge of #124356 - fmease:fewer-magic-numbers-in-names, r=lcnr 2024-05-01 00:04:36 +00:00
hir_wf_check.rs Do not ICE on AnonConsts in diagnostic_hir_wf_check 2024-04-22 10:31:32 +05:30
impl_wf_check.rs Merge check_mod_impl_wf and check_mod_type_wf 2024-03-07 06:27:09 +00:00
lib.rs Stabilize generic NonZero. 2024-04-22 18:48:47 +02:00
structured_errors.rs Rename StructuredDiagnostic as StructuredDiag. 2024-03-05 12:15:12 +11:00