Skip to content

Commit

Permalink
Rollup merge of rust-lang#39453 - nrc:save-path, r=nikomatsakis
Browse files Browse the repository at this point in the history
save-analysis: be more paranoid about generated paths

fixes rust-lang/rls#160
  • Loading branch information
frewsxcv authored Feb 5, 2017
2 parents 4db7510 + 395f23c commit 93abc8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/librustc_save_analysis/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
-> 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 {
Expand Down
1 change: 1 addition & 0 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1691,6 +1691,7 @@ impl<'a> Parser<'a> {
}

// 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.
Expand Down

0 comments on commit 93abc8d

Please sign in to comment.