Skip to content

Commit 395f23c

Browse files
committed
save-analysis: be more paranoid about generated paths
fixes rust-lang/rls#160
1 parent 24055d0 commit 395f23c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/librustc_save_analysis/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,9 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
430430
-> Option<TypeRefData> {
431431
self.lookup_ref_id(trait_ref.ref_id).and_then(|def_id| {
432432
let span = trait_ref.path.span;
433+
if generated_code(span) {
434+
return None;
435+
}
433436
let sub_span = self.span_utils.sub_span_for_type_name(span).or(Some(span));
434437
filter!(self.span_utils, sub_span, span, None);
435438
Some(TypeRefData {

src/libsyntax/parse/parser.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1693,6 +1693,7 @@ impl<'a> Parser<'a> {
16931693
}
16941694

16951695
// Assemble the span.
1696+
// FIXME(#39450) This is bogus if part of the path is macro generated.
16961697
let span = mk_sp(lo, self.prev_span.hi);
16971698

16981699
// Assemble the result.

0 commit comments

Comments
 (0)