save-analysis: be more paranoid about generated paths
fixes https://github.com/rust-lang-nursery/rls/issues/160
This commit is contained in:
@@ -430,6 +430,9 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
|
|||||||
-> Option<TypeRefData> {
|
-> Option<TypeRefData> {
|
||||||
self.lookup_ref_id(trait_ref.ref_id).and_then(|def_id| {
|
self.lookup_ref_id(trait_ref.ref_id).and_then(|def_id| {
|
||||||
let span = trait_ref.path.span;
|
let span = trait_ref.path.span;
|
||||||
|
if generated_code(span) {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
let sub_span = self.span_utils.sub_span_for_type_name(span).or(Some(span));
|
let sub_span = self.span_utils.sub_span_for_type_name(span).or(Some(span));
|
||||||
filter!(self.span_utils, sub_span, span, None);
|
filter!(self.span_utils, sub_span, span, None);
|
||||||
Some(TypeRefData {
|
Some(TypeRefData {
|
||||||
|
|||||||
@@ -1693,6 +1693,7 @@ impl<'a> Parser<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Assemble the span.
|
// Assemble the span.
|
||||||
|
// FIXME(#39450) This is bogus if part of the path is macro generated.
|
||||||
let span = mk_sp(lo, self.prev_span.hi);
|
let span = mk_sp(lo, self.prev_span.hi);
|
||||||
|
|
||||||
// Assemble the result.
|
// Assemble the result.
|
||||||
|
|||||||
Reference in New Issue
Block a user