Rollup merge of #39453 - nrc:save-path, r=nikomatsakis

save-analysis: be more paranoid about generated paths

fixes https://github.com/rust-lang-nursery/rls/issues/160
This commit is contained in:
Corey Farwell
2017-02-05 09:14:49 -05:00
committed by GitHub
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -430,6 +430,9 @@ pub fn get_trait_ref_data(&self,
-> Option<TypeRefData> {
self.lookup_ref_id(trait_ref.ref_id).and_then(|def_id| {
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));
filter!(self.span_utils, sub_span, span, None);
Some(TypeRefData {
+1
View File
@@ -1691,6 +1691,7 @@ pub fn parse_path(&mut self, mode: PathStyle) -> PResult<'a, ast::Path> {
}
// 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);
// Assemble the result.