about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/graph.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-10-09 16:26:01 +0200
committerGitHub <noreply@github.com>2023-10-09 16:26:01 +0200
commit374c885f4a29aaf391c5d5eaa1d4c01164725333 (patch)
tree267ba9857b3d5329066ab34c413d39ef6ad44db8 /compiler/rustc_mir_transform/src/coverage/graph.rs
parent389747c41dc81a23088d8aa27425923d7d81f70c (diff)
parent23a3b9e44926aa0d4c49a722654ef59f010b55ba (diff)
downloadrust-374c885f4a29aaf391c5d5eaa1d4c01164725333.tar.gz
rust-374c885f4a29aaf391c5d5eaa1d4c01164725333.zip
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.
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/graph.rs')
0 files changed, 0 insertions, 0 deletions