Skip to content

Commit 82410e8

Browse files
wildarchsaleemjaffer
authored andcommitted
impl pointee_info_at in TyLayout.
1 parent 7257fc3 commit 82410e8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/librustc_codegen_llvm/abi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use rustc_target::abi::call::ArgType;
1818
use rustc_codegen_ssa::traits::*;
1919

2020
use rustc_target::abi::{HasDataLayout, LayoutOf, Size, TyLayout, Abi as LayoutAbi};
21-
use rustc::ty::{self, Ty, Instance};
21+
use rustc::ty::{self, Ty, Instance, ParamEnv};
2222
use rustc::ty::layout::{self, PointerKind};
2323

2424
use libc::c_uint;
@@ -484,7 +484,7 @@ impl<'tcx> FnTypeExt<'tcx> for FnType<'tcx, Ty<'tcx>> {
484484
}
485485
}
486486

487-
if let Some(pointee) = layout.pointee_info_at(cx, offset) {
487+
if let Some(pointee) = layout.pointee_info_at(cx, offset, ParamEnv::reveal_all()) {
488488
if let Some(kind) = pointee.safe {
489489
attrs.pointee_size = pointee.size;
490490
attrs.pointee_align = Some(pointee.align);

src/librustc_target/abi/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,10 @@ impl<'a, Ty> TyLayout<'a, Ty> {
958958
where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> {
959959
Ty::field(self, cx, i)
960960
}
961+
pub fn pointee_info_at<C>(self, cx: &C, offset: Size, param_env: Ty::ParamEnv) -> Option<PointeeInfo>
962+
where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> {
963+
Ty::pointee_info_at(self, cx, offset, param_env)
964+
}
961965
}
962966

963967
impl<'a, Ty> TyLayout<'a, Ty> {

0 commit comments

Comments
 (0)