diff options
| author | Michael Goulet <michael@errs.io> | 2024-08-25 16:02:11 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-08-25 16:02:29 -0400 |
| commit | 48f43fa0ed2f2e4ff2d9d53b9d72cfbc108a9034 (patch) | |
| tree | 26b26bdc8f2c75b6343e3194409a7c9a16e64cb4 /compiler/rustc_const_eval/src/interpret/cast.rs | |
| parent | 89103466d77a3ae068bab0fd17c53bf7104f627b (diff) | |
| download | rust-48f43fa0ed2f2e4ff2d9d53b9d72cfbc108a9034.tar.gz rust-48f43fa0ed2f2e4ff2d9d53b9d72cfbc108a9034.zip | |
Avoid taking reference of &TyKind
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/cast.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/cast.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/cast.rs b/compiler/rustc_const_eval/src/interpret/cast.rs index 4901e4b2a41..e8c9f145eea 100644 --- a/compiler/rustc_const_eval/src/interpret/cast.rs +++ b/compiler/rustc_const_eval/src/interpret/cast.rs @@ -388,7 +388,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { let (src_pointee_ty, dest_pointee_ty) = self.tcx.struct_lockstep_tails_for_codegen(source_ty, cast_ty, self.param_env); - match (&src_pointee_ty.kind(), &dest_pointee_ty.kind()) { + match (src_pointee_ty.kind(), dest_pointee_ty.kind()) { (&ty::Array(_, length), &ty::Slice(_)) => { let ptr = self.read_pointer(src)?; let val = Immediate::new_slice( @@ -478,9 +478,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { dest: &PlaceTy<'tcx, M::Provenance>, ) -> InterpResult<'tcx> { trace!("Unsizing {:?} of type {} into {}", *src, src.layout.ty, cast_ty.ty); - match (&src.layout.ty.kind(), &cast_ty.ty.kind()) { + match (src.layout.ty.kind(), cast_ty.ty.kind()) { (&ty::Ref(_, s, _), &ty::Ref(_, c, _) | &ty::RawPtr(c, _)) - | (&ty::RawPtr(s, _), &ty::RawPtr(c, _)) => self.unsize_into_ptr(src, dest, *s, *c), + | (&ty::RawPtr(s, _), &ty::RawPtr(c, _)) => self.unsize_into_ptr(src, dest, s, c), (&ty::Adt(def_a, _), &ty::Adt(def_b, _)) => { assert_eq!(def_a, def_b); // implies same number of fields |
