-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Do not ICE on AnonConst
s in diagnostic_hir_wf_check
#124219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
r? @Nadrieril rustbot has assigned @Nadrieril. Use |
r? compiler |
@gurry: Please make sure to actually explain in your PR descriptions why something is happening and why your changes are correct, if it's not obvious from the title or the code itself. In this case, it's not really obvious |
r? compiler-errors |
Sorry @compiler-errors. Have added the explanation in the description now. |
8dd3f4f
to
446f78d
Compare
@rustbot label -S-waiting-on-author +S-waiting-on-review |
@bors r+ |
…onst, r=compiler-errors Do not ICE on `AnonConst`s in `diagnostic_hir_wf_check` Fixes rust-lang#122989 Below is the snippet from rust-lang#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.
☀️ Test successful - checks-actions |
Finished benchmarking commit (faefc61): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 675.093s -> 677.065s (0.29%) |
Fixes #122989
Below is the snippet from #122989 that ICEs:
The
AnonConst
that triggers the ICE is the2
in the paramconst N: N<2> = 1
. The currently existing code indiagnostic_hir_wf_check
deals only withAnonConst
s that are default values of some param, but the2
is not a default value. It is just anAnonConst
HIR node inside aTraitRef
HIR node corresponding toN<2>
. Therefore the existing code cannot handle it and this PR ensures that it does.