impl pointee_info_at
in TyLayout.
This commit is contained in:
parent
7257fc34de
commit
82410e800f
@ -18,7 +18,7 @@ use rustc_target::abi::call::ArgType;
|
||||
use rustc_codegen_ssa::traits::*;
|
||||
|
||||
use rustc_target::abi::{HasDataLayout, LayoutOf, Size, TyLayout, Abi as LayoutAbi};
|
||||
use rustc::ty::{self, Ty, Instance};
|
||||
use rustc::ty::{self, Ty, Instance, ParamEnv};
|
||||
use rustc::ty::layout::{self, PointerKind};
|
||||
|
||||
use libc::c_uint;
|
||||
@ -484,7 +484,7 @@ impl<'tcx> FnTypeExt<'tcx> for FnType<'tcx, Ty<'tcx>> {
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(pointee) = layout.pointee_info_at(cx, offset) {
|
||||
if let Some(pointee) = layout.pointee_info_at(cx, offset, ParamEnv::reveal_all()) {
|
||||
if let Some(kind) = pointee.safe {
|
||||
attrs.pointee_size = pointee.size;
|
||||
attrs.pointee_align = Some(pointee.align);
|
||||
|
@ -958,6 +958,10 @@ impl<'a, Ty> TyLayout<'a, Ty> {
|
||||
where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> {
|
||||
Ty::field(self, cx, i)
|
||||
}
|
||||
pub fn pointee_info_at<C>(self, cx: &C, offset: Size, param_env: Ty::ParamEnv) -> Option<PointeeInfo>
|
||||
where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> {
|
||||
Ty::pointee_info_at(self, cx, offset, param_env)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, Ty> TyLayout<'a, Ty> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user