Auto merge of #38203 - nrc:save-wr, r=eddyb

save-analysis: fix a few generated code errors
This commit is contained in:
bors
2016-12-09 18:43:33 +00:00
2 changed files with 11 additions and 9 deletions
+10 -8
View File
@@ -1326,16 +1326,18 @@ fn visit_ty(&mut self, t: &'l ast::Ty) {
self.process_macro_use(t.span, t.id);
match t.node {
ast::TyKind::Path(_, ref path) => {
if self.span.filter_generated(None, t.span) {
return;
}
if let Some(id) = self.lookup_def_id(t.id) {
let sub_span = self.span.sub_span_for_type_name(t.span);
if !self.span.filter_generated(sub_span, t.span) {
self.dumper.type_ref(TypeRefData {
span: sub_span.expect("No span found for type ref"),
ref_id: Some(id),
scope: self.cur_scope,
qualname: String::new()
}.lower(self.tcx));
}
self.dumper.type_ref(TypeRefData {
span: sub_span.expect("No span found for type ref"),
ref_id: Some(id),
scope: self.cur_scope,
qualname: String::new()
}.lower(self.tcx));
}
self.write_sub_paths_truncated(path, false);
+1 -1
View File
@@ -250,8 +250,8 @@ pub fn get_item_data(&self, item: &ast::Item) -> Option<Data> {
match typ.node {
// Common case impl for a struct or something basic.
ast::TyKind::Path(None, ref path) => {
filter!(self.span_utils, None, path.span, None);
sub_span = self.span_utils.sub_span_for_type_name(path.span);
filter!(self.span_utils, sub_span, path.span, None);
type_data = self.lookup_ref_id(typ.id).map(|id| {
TypeRefData {
span: sub_span.unwrap(),