Skip to content

Commit d76daf5

Browse files
committedApr 4, 2017
rebased
1 parent ccdbb31 commit d76daf5

File tree

1 file changed

+5
-1
lines changed
  • src/librustc_save_analysis

1 file changed

+5
-1
lines changed
 

‎src/librustc_save_analysis/lib.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
125125
match item.node {
126126
ast::ForeignItemKind::Fn(ref decl, ref generics) => {
127127
let sub_span = self.span_utils.sub_span_after_keyword(item.span, keywords::Fn);
128+
filter!(self.span_utils, sub_span, item.span, None);
128129
Some(Data::FunctionData(FunctionData {
129130
id: item.id,
130131
name: item.ident.to_string(),
@@ -137,11 +138,13 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
137138
parent: None,
138139
docs: docs_for_attrs(&item.attrs),
139140
sig: self.sig_base_extern(item),
141+
attributes: item.attrs.clone(),
140142
}))
141143
}
142144
ast::ForeignItemKind::Static(ref ty, m) => {
143145
let keyword = if m { keywords::Mut } else { keywords::Static };
144146
let sub_span = self.span_utils.sub_span_after_keyword(item.span, keyword);
147+
filter!(self.span_utils, sub_span, item.span, None);
145148
Some(Data::VariableData(VariableData {
146149
id: item.id,
147150
kind: VariableKind::Static,
@@ -155,6 +158,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
155158
visibility: From::from(&item.vis),
156159
docs: docs_for_attrs(&item.attrs),
157160
sig: Some(self.sig_base_extern(item)),
161+
attributes: item.attrs.clone(),
158162
}))
159163
}
160164
}
@@ -797,7 +801,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
797801
let ident_start = text.find(&name).expect("Name not in signature?");
798802
let ident_end = ident_start + name.len();
799803
Signature {
800-
span: mk_sp(item.span.lo, item.span.lo + BytePos(text.len() as u32)),
804+
span: Span { hi: item.span.lo + BytePos(text.len() as u32), ..item.span },
801805
text: text,
802806
ident_start: ident_start,
803807
ident_end: ident_end,

0 commit comments

Comments
 (0)