Skip to content

Commit

Permalink
partially fixes rust-lang#52482
Browse files Browse the repository at this point in the history
  • Loading branch information
Saleem Jaffer committed Feb 23, 2019
1 parent 74e35d2 commit ac47cee
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/librustc_mir/hair/cx/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,13 +652,8 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
user_ty,
);

// Check to see if this cast is a "coercion cast", where the cast is actually done
// using a coercion (or is a no-op).
let cast = if let Some(&TyCastKind::CoercionCast) =
cx.tables()
.cast_kinds()
.get(source.hir_id)
{
let source_ty = cx.tables().expr_ty(source);
let cast = if source_ty == expr_ty {
// Convert the lexpr to a vexpr.
ExprKind::Use { source: source.to_ref() }
} else {
Expand Down

0 comments on commit ac47cee

Please sign in to comment.