mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
adding is_freeze to TyLayoutMethods
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user