rust/compiler/rustc_hir_analysis/src
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
..
astconv Fix suggestion span involving wrongly placed generic arg on enum variants 2023-10-09 08:04:00 +05:30
check Auto merge of #114811 - estebank:impl-ambiguity, r=wesleywiser 2023-10-06 18:44:32 +00:00
coherence Reorder fullfillment errors to keep more interesting ones first 2023-10-04 02:04:14 +00:00
collect Don't store lazyness in DefKind 2023-09-26 02:53:59 +00:00
impl_wf_check Reorder fullfillment errors to keep more interesting ones first 2023-10-04 02:04:14 +00:00
outlives refactor(rustc_middle): Substs -> GenericArg 2023-07-14 13:27:35 +01:00
structured_errors lower impl const to bind to host effect param 2023-08-06 13:34:53 +00:00
variance Optimize some alloc_from_iter call sites. 2023-10-03 18:12:37 +11:00
autoderef.rs Structurally normalize weak and inherent too 2023-08-07 19:05:59 +00:00
bounds.rs Remove constness from TraitPredicate 2023-08-02 15:38:00 +00:00
check_unused.rs inline format!() args from rustc_codegen_llvm to the end (4) 2023-07-25 23:20:28 +02:00
collect.rs don't clone copy types 2023-09-28 00:20:32 +02:00
constrained_generic_params.rs Opaques do not constrain generic params 2023-08-12 17:14:13 +00:00
errors.rs Auto merge of #115821 - obeis:hir-analysis-migrate-diagnostics-5, r=compiler-errors 2023-09-29 00:24:57 +00:00
hir_wf_check.rs Lower generic const items to HIR 2023-07-28 22:21:40 +02:00
impl_wf_check.rs Use {Local}ModDefId in many queries 2023-08-14 07:22:48 +00:00
lib.rs rustc_hir_analysis: add a helper to check function the signature mismatches 2023-09-19 18:15:23 +02:00
structured_errors.rs rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00