Closed
Description
[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.
- https://travis-ci.org/rust-lang/rust/jobs/263196246 from Expose all OS-specific modules in libstd doc. #43348
- proc_macro: implement
TokenTree
,TokenKind
, hygienicquote!
, and other API #40939 (comment) - Support dynamically-linked and/or native musl targets #40113 (comment)
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.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
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_ref
will only produce the span foras_ref
(one segment).However, the
ast::Path
of 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_segments
anymore.-Z save-analysis
+ refactoring #4382610 remaining items