Skip to content

Commit

Permalink
save-analysis: Simplify match arm for type node def
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed May 16, 2019
1 parent 7b9f9fa commit 9401a67
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/librustc_save_analysis/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,10 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
Node::Pat(&hir::Pat {
node: hir::PatKind::TupleStruct(ref qpath, ..),
..
}) |
Node::Ty(&hir::Ty {
node: hir::TyKind::Path(ref qpath),
..
}) => {
let hir_id = self.tcx.hir().node_to_hir_id(id);
self.tables.qpath_def(qpath, hir_id)
Expand All @@ -657,11 +661,6 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
..
}) => HirDef::Local(self.tcx.hir().hir_to_node_id(canonical_id)),

Node::Ty(&hir::Ty { node: hir::TyKind::Path(ref qpath), .. } ) => {
let hir_id = self.tcx.hir().node_to_hir_id(id);
self.tables.qpath_def(qpath, hir_id)
},

_ => HirDef::Err,
}
}
Expand Down

0 comments on commit 9401a67

Please sign in to comment.