Skip to content

Commit

Permalink
Use better span when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Feb 5, 2018
1 parent 05685bd commit f13d8dc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/librustc_mir/shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,13 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> {
let substs = tcx.mk_substs_trait(self_ty, &[]);
let sig = tcx.fn_sig(def_id).subst(tcx, substs);
let sig = tcx.erase_late_bound_regions(&sig);
let span = tcx.def_span(def_id);
let span_def_id = if let Some(did) = self_ty.ty_to_def_id() {
did
} else {
def_id
};

let span = tcx.def_span(span_def_id);

CloneShimBuilder {
tcx,
Expand Down

0 comments on commit f13d8dc

Please sign in to comment.