Skip to content

Commit

Permalink
rebased
Browse files Browse the repository at this point in the history
  • Loading branch information
nrc committed Mar 28, 2017
1 parent 28173d3 commit 8f6b68c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc_save_analysis/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
match item.node {
ast::ForeignItemKind::Fn(ref decl, ref generics) => {
let sub_span = self.span_utils.sub_span_after_keyword(item.span, keywords::Fn);
filter!(self.span_utils, sub_span, item.span, None);
Some(Data::FunctionData(FunctionData {
id: item.id,
name: item.ident.to_string(),
Expand All @@ -136,11 +137,13 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
parent: None,
docs: docs_for_attrs(&item.attrs),
sig: self.sig_base_extern(item),
attributes: item.attrs.clone(),
}))
}
ast::ForeignItemKind::Static(ref ty, m) => {
let keyword = if m { keywords::Mut } else { keywords::Static };
let sub_span = self.span_utils.sub_span_after_keyword(item.span, keyword);
filter!(self.span_utils, sub_span, item.span, None);
Some(Data::VariableData(VariableData {
id: item.id,
kind: VariableKind::Static,
Expand All @@ -154,6 +157,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
visibility: From::from(&item.vis),
docs: docs_for_attrs(&item.attrs),
sig: Some(self.sig_base_extern(item)),
attributes: item.attrs.clone(),
}))
}
}
Expand Down

0 comments on commit 8f6b68c

Please sign in to comment.