From 798fb856515fd2e9aeedbfe21a903c09cf85c165 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Fri, 3 Jul 2020 16:40:57 +0200 Subject: [PATCH] Fix assert_assignable --- src/value_and_place.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/value_and_place.rs b/src/value_and_place.rs index 1d0990163bb..c9516a98bfe 100644 --- a/src/value_and_place.rs +++ b/src/value_and_place.rs @@ -406,6 +406,10 @@ impl<'tcx> CPlace<'tcx> { to_ty: Ty<'tcx>, ) { match (&from_ty.kind, &to_ty.kind) { + (ty::Ref(_, a, _), ty::Ref(_, b, _)) + | (ty::RawPtr(TypeAndMut { ty: a, mutbl: _}), ty::RawPtr(TypeAndMut { ty: b, mutbl: _})) => { + assert_assignable(fx, a, b); + } (ty::FnPtr(_), ty::FnPtr(_)) => { let from_sig = fx.tcx.normalize_erasing_late_bound_regions( ParamEnv::reveal_all(),