Skip to content

Commit 1e8bfae

Browse files
committed
Remove unnecessary changes
1 parent b7a114e commit 1e8bfae

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
@@ -1471,12 +1471,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
14711471
StatementKind::Assign(box (dest, rvalue)) => {
14721472
// LHS and RHS of the assignment must have the same type.
14731473
let left_ty = dest.ty(&self.body.local_decls, self.tcx).ty;
1474-
let right_ty = if let Rvalue::Reborrow(target_ty, _, _) = rvalue {
1475-
// CoerceShared changes the type from right_ty to target_ty.
1476-
*target_ty
1477-
} else {
1478-
rvalue.ty(&self.body.local_decls, self.tcx)
1479-
};
1474+
let right_ty = rvalue.ty(&self.body.local_decls, self.tcx);
14801475

14811476
if !self.mir_assign_valid_types(right_ty, left_ty) {
14821477
self.fail(
@@ -1497,11 +1492,6 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
14971492
{
14981493
self.fail(location, "assignment to a `DerefTemp` must use `CopyForDeref`")
14991494
}
1500-
1501-
if matches!(rvalue, Rvalue::Reborrow(..)) {
1502-
// Reborrow/CoerceShared must not call into super_statement.
1503-
return;
1504-
}
15051495
}
15061496
StatementKind::AscribeUserType(..) => {
15071497
if self.body.phase >= MirPhase::Runtime(RuntimePhase::Initial) {

0 commit comments

Comments
 (0)