adding is_freeze to TyLayoutMethods
This commit is contained in:
parent
852dd491ef
commit
8802dc037e
2 changed files with 17 additions and 0 deletions
|
@ -1961,6 +1961,14 @@ impl<'a, 'tcx, C> TyLayoutMethods<'tcx, C> for Ty<'tcx>
|
|||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
|
|
|
@ -947,6 +947,11 @@ pub trait TyLayoutMethods<'a, C: LayoutOf<Ty = Self>>: Sized {
|
|||
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 @@ impl<'a, Ty> TyLayout<'a, Ty> {
|
|||
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> {
|
||||
|
|
Loading…
Reference in a new issue