Skip to content

Commit ac47cee

Browse files
author
Saleem Jaffer
committed
partially fixes rust-lang#52482
1 parent 74e35d2 commit ac47cee

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/librustc_mir/hair/cx/expr.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -652,13 +652,8 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
652652
user_ty,
653653
);
654654

655-
// Check to see if this cast is a "coercion cast", where the cast is actually done
656-
// using a coercion (or is a no-op).
657-
let cast = if let Some(&TyCastKind::CoercionCast) =
658-
cx.tables()
659-
.cast_kinds()
660-
.get(source.hir_id)
661-
{
655+
let source_ty = cx.tables().expr_ty(source);
656+
let cast = if source_ty == expr_ty {
662657
// Convert the lexpr to a vexpr.
663658
ExprKind::Use { source: source.to_ref() }
664659
} else {

0 commit comments

Comments
 (0)