Skip to content

Commit 5aee931

Browse files
committed
Rollup merge of rust-lang#22691 - nick29581:fix-save-impl, r=huonw
r? @huonw
2 parents 07b6b74 + 04b0a3a commit 5aee931

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

src/librustc_trans/save/mod.rs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -663,23 +663,21 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
663663
match typ.node {
664664
// Common case impl for a struct or something basic.
665665
ast::TyPath(ref path, id) => {
666-
match self.lookup_type_ref(id) {
667-
Some(id) => {
668-
let sub_span = self.span.sub_span_for_type_name(path.span);
669-
self.fmt.ref_str(recorder::TypeRef,
670-
path.span,
671-
sub_span,
672-
id,
673-
self.cur_scope);
674-
self.fmt.impl_str(path.span,
675-
sub_span,
676-
item.id,
677-
Some(id),
678-
trait_id,
679-
self.cur_scope);
680-
},
681-
None => ()
682-
}
666+
let sub_span = self.span.sub_span_for_type_name(path.span);
667+
let self_id = self.lookup_type_ref(id).map(|id| {
668+
self.fmt.ref_str(recorder::TypeRef,
669+
path.span,
670+
sub_span,
671+
id,
672+
self.cur_scope);
673+
id
674+
});
675+
self.fmt.impl_str(path.span,
676+
sub_span,
677+
item.id,
678+
self_id,
679+
trait_id,
680+
self.cur_scope);
683681
},
684682
_ => {
685683
// Less useful case, impl for a compound type.

0 commit comments

Comments
 (0)