You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[00:33:43] ERROR:rustc_save_analysis::dump_visitor: Mis-calculated spans for path 'AsRef<U>::as_ref'. Found 1 spans, expected 2. Found spans:
[00:33:43] ERROR:rustc_save_analysis::dump_visitor: 'as_ref' in /checkout/src/libcore/convert.rs, line 355
This has been seen in a few different places, e.g.
I don't think it actually causes build failures, but it seems suspicious and something that should be fixed. I'll use logobble to dig up some more tomorrowish.
The problem is that SpanUtils::spans_with_brackets (called from spans_for_path_segments) does not handle UFCS path at all. It will ignore everything between angle brackets, so input like <T as AsRef<U>>::as_ref will only produce the span for as_ref (one segment).
However, the ast::Path of this will be AsRef<U>::as_ref (two segments), thus the mismatch error.
Thanks to #40369, each PathSegment already contain the span, so we shouldn't need to use spans_for_path_segments anymore.
Activity
Mark-Simulacrum commentedon Aug 11, 2017
cc @nrc -- any ideas on what could be causing this?
kennytm commentedon Aug 12, 2017
The problem is that
SpanUtils::spans_with_brackets(called fromspans_for_path_segments) does not handle UFCS path at all. It will ignore everything between angle brackets, so input like<T as AsRef<U>>::as_refwill only produce the span foras_ref(one segment).However, the
ast::Pathof this will beAsRef<U>::as_ref(two segments), thus the mismatch error.Thanks to #40369, each PathSegment already contain the span, so we shouldn't need to use
spans_for_path_segmentsanymore.Auto merge of #43826 - kennytm:fix-43796-mis-calculated-spans, r=petr…