now we can make scalar_to_ptr a method on Scalar

This commit is contained in:
Ralf Jung
2022-07-23 10:36:57 -04:00
parent 665a7e8f56
commit 4e89a7c293
10 changed files with 41 additions and 45 deletions

View File

@@ -629,7 +629,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
Ok(Some((size, align)))
}
ty::Dynamic(..) => {
let vtable = self.scalar_to_ptr(metadata.unwrap_meta())?;
let vtable = metadata.unwrap_meta().to_pointer(self)?;
// Read size and align from vtable (already checks size).
Ok(Some(self.get_vtable_size_and_align(vtable)?))
}