Skip to content

Commit 06b7ccd

Browse files
committed
Remove unnecessary changes
1 parent 8c244ff commit 06b7ccd

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

compiler/rustc_mir_transform/src/validate.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,12 +1463,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
14631463
StatementKind::Assign(box (dest, rvalue)) => {
14641464
// LHS and RHS of the assignment must have the same type.
14651465
let left_ty = dest.ty(&self.body.local_decls, self.tcx).ty;
1466-
let right_ty = if let Rvalue::Reborrow(target_ty, _, _) = rvalue {
1467-
// CoerceShared changes the type from right_ty to target_ty.
1468-
*target_ty
1469-
} else {
1470-
rvalue.ty(&self.body.local_decls, self.tcx)
1471-
};
1466+
let right_ty = rvalue.ty(&self.body.local_decls, self.tcx);
14721467

14731468
if !self.mir_assign_valid_types(right_ty, left_ty) {
14741469
self.fail(
@@ -1489,11 +1484,6 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
14891484
{
14901485
self.fail(location, "assignment to a `DerefTemp` must use `CopyForDeref`")
14911486
}
1492-
1493-
if matches!(rvalue, Rvalue::Reborrow(..)) {
1494-
// Reborrow/CoerceShared must not call into super_statement.
1495-
return;
1496-
}
14971487
}
14981488
StatementKind::AscribeUserType(..) => {
14991489
if self.body.phase >= MirPhase::Runtime(RuntimePhase::Initial) {

0 commit comments

Comments
 (0)