rust/compiler/rustc_hir_analysis
Matthias Krüger 374c885f4a
Rollup merge of #116537 - gurry:116473-ice-sugg-overlap, r=compiler-errors
Fix suggestion span involving wrongly placed generic arg on variant

Fixes #116473

The span computation was wrong. It went from the end of the variant to the end of the (wrongly placed) args. However, the variant lived in a different expansion and this resulted in a nonsensical span that overlaps with another and thereby leads to the ICE.

In the fix I've changed span computation to not be based on the location of the variant, but purely on the location of the args. I simply extend the start of the args span 2 positions to the left and that includes the `::` and that's all we need apparently.

This approach produces a correct span regardless of which macro/expansion the args reside in and where the variant is.
2023-10-09 16:26:01 +02:00
..
src Rollup merge of #116537 - gurry:116473-ice-sugg-overlap, r=compiler-errors 2023-10-09 16:26:01 +02:00
Cargo.toml drop unused deps, gate libc under unix for one crate 2023-04-22 15:22:21 +03:00
README.md rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00
messages.ftl Rollup merge of #115863 - chenyukang:yukang-add-message-tidy-check, r=davidtwco 2023-10-03 12:24:11 +02:00

README.md

For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.