Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 9c0d18c

Browse files
committed
Simplify assert_assignable
Assignments are no longer used to implicitly cast between &mut T and &T
1 parent b79102c commit 9c0d18c

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/value_and_place.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -362,17 +362,6 @@ impl<'tcx> CPlace<'tcx> {
362362
to_ty: Ty<'tcx>,
363363
) {
364364
match (&from_ty.kind, &to_ty.kind) {
365-
(ty::Ref(_, t, Mutability::Not), ty::Ref(_, u, Mutability::Not))
366-
| (ty::Ref(_, t, Mutability::Mut), ty::Ref(_, u, Mutability::Not))
367-
| (ty::Ref(_, t, Mutability::Mut), ty::Ref(_, u, Mutability::Mut)) => {
368-
assert_assignable(fx, t, u);
369-
// &mut T -> &T is allowed
370-
// &'a T -> &'b T is allowed
371-
}
372-
(ty::Ref(_, _, Mutability::Not), ty::Ref(_, _, Mutability::Mut)) => panic!(
373-
"Cant assign value of type {} to place of type {}",
374-
from_ty, to_ty
375-
),
376365
(ty::FnPtr(_), ty::FnPtr(_)) => {
377366
let from_sig = fx.tcx.normalize_erasing_late_bound_regions(
378367
ParamEnv::reveal_all(),

0 commit comments

Comments
 (0)