Update src/librustc_mir/interpret/memory.rs

Co-Authored-By: Ralf Jung <post@ralfj.de>
This commit is contained in:
Oliver Scherer 2019-07-26 17:43:49 +02:00 committed by GitHub
parent 796e7a8d7c
commit 6e04ca7fb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -548,7 +548,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
let alloc = self.tcx.alloc_map.lock().get(id);
match alloc {
Some(GlobalAlloc::Static(did)) => {
// Use size and align of the type
// Use size and align of the type.
let ty = self.tcx.type_of(did);
let layout = self.tcx.layout_of(ParamEnv::empty().and(ty)).unwrap();
Ok((layout.size, layout.align.abi))