Closed
Description
rust/src/librustc_mir/interpret/place.rs
Line 856 in 02046a5
&mut T
to a &T
variable. We should instead employ a function like
fn mir_assign_valid_types(dst: Ty<'tcx>, src: Ty<'tcx>) {
dst == src || match (&dst.kind, &src.kind) {
(ty::Ref(_, _, dst_pointee), ty::Ref(_, _, src_pointee)) => dst_pointee == src_pointee,
_ => false,
}
}
(source #69700 (comment))
be sure to also add appropriate mutability checks to the patterns (mutable for the source, immutable for the dest)