From 4a51801c394337a64850788c18cbf86c4cbfb35f Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Fri, 18 Oct 2019 12:21:09 +0200 Subject: [PATCH] Use dedicated method for getting the type size Co-Authored-By: Nikita Popov --- src/librustc_codegen_llvm/intrinsic.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_codegen_llvm/intrinsic.rs b/src/librustc_codegen_llvm/intrinsic.rs index e940a42be7de..6c0728d7a07a 100644 --- a/src/librustc_codegen_llvm/intrinsic.rs +++ b/src/librustc_codegen_llvm/intrinsic.rs @@ -697,7 +697,7 @@ impl IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> { "ptr_offset_from" => { let ty = substs.type_at(0); - let pointee_size = self.layout_of(ty).size; + let pointee_size = self.size_of(ty); // This is the same sequence that Clang emits for pointer subtraction. // It can be neither `nsw` nor `nuw` because the input is treated as