- let mut place = self.ref_to_mplace(val)?;
- // Pointer tag tracking might want to adjust the tag.
- let mutbl = match val.layout.ty.sty {
- // `builtin_deref` considers boxes immutable, that's useless for our purposes
- ty::Ref(_, _, mutbl) => Some(mutbl),
- ty::Adt(def, _) if def.is_box() => Some(hir::MutMutable),
- ty::RawPtr(_) => None,
- _ => bug!("Unexpected pointer type {}", val.layout.ty),
- };
- place.mplace.ptr = M::tag_dereference(self, place, mutbl)?;
- Ok(place)