Skip to content

Commit

Permalink
Auto merge of rust-lang#26307 - nrc:save-bugs, r=cmr
Browse files Browse the repository at this point in the history
r? @brson (or anyone, really)
  • Loading branch information
bors committed Jun 15, 2015
2 parents 7517ecf + a54bbac commit 0d82fb5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/librustc_trans/save/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,17 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
match typ.node {
// Common case impl for a struct or something basic.
ast::TyPath(None, ref path) => {
sub_span = self.span_utils.sub_span_for_type_name(path.span);
sub_span = self.span_utils.sub_span_for_type_name(path.span).unwrap();
type_data = self.lookup_ref_id(typ.id).map(|id| TypeRefData {
span: sub_span.unwrap(),
span: sub_span,
scope: parent,
ref_id: id,
});
},
_ => {
// Less useful case, impl for a compound type.
sub_span = self.span_utils.sub_span_for_type_name(typ.span);
let span = typ.span;
sub_span = self.span_utils.sub_span_for_type_name(span).unwrap_or(span);
}
}

Expand All @@ -273,7 +274,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {

Data::ImplData(ImplData {
id: item.id,
span: sub_span.unwrap(),
span: sub_span,
scope: parent,
trait_ref: trait_data,
self_ref: type_data,
Expand Down Expand Up @@ -320,9 +321,10 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
parent: NodeId)
-> Option<TypeRefData> {
self.lookup_ref_id(trait_ref.ref_id).map(|def_id| {
let sub_span = self.span_utils.sub_span_for_type_name(trait_ref.path.span);
let span = trait_ref.path.span;
let sub_span = self.span_utils.sub_span_for_type_name(span).unwrap_or(span);
TypeRefData {
span: sub_span.unwrap(),
span: sub_span,
scope: parent,
ref_id: def_id,
}
Expand Down

0 comments on commit 0d82fb5

Please sign in to comment.