adding is_freeze to TyLayoutMethods

This commit is contained in:
Saleem Jaffer
2019-05-03 13:05:10 +05:30
parent 852dd491ef
commit 8802dc037e
2 changed files with 17 additions and 0 deletions
+8
View File
@@ -1961,6 +1961,14 @@ fn pointee_info_at(
}
}
fn is_freeze(
this: TyLayout<'tcx>,
cx: &C,
param_env: Self::ParamEnv,
)-> bool {
this.ty.is_freeze(cx.tcx(), param_env, DUMMY_SP)
}
}
struct Niche {
+9
View File
@@ -947,6 +947,11 @@ fn pointee_info_at(
offset: Size,
param_env: Self::ParamEnv,
) -> Option<PointeeInfo>;
fn is_freeze(
this: TyLayout<'a, Self>,
cx: &C,
param_env: Self::ParamEnv,
)-> bool;
}
impl<'a, Ty> TyLayout<'a, Ty> {
@@ -964,6 +969,10 @@ pub fn pointee_info_at<C>(
where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> {
Ty::pointee_info_at(self, cx, offset, param_env)
}
pub fn is_freeze<C>(self, cx: &C, param_env: Ty::ParamEnv) -> bool
where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> {
Ty::is_freeze(self, cx, param_env)
}
}
impl<'a, Ty> TyLayout<'a, Ty> {