diff --git a/src/librustc/ty/layout.rs b/src/librustc/ty/layout.rs index 319db52fe20..e4f80838d84 100644 --- a/src/librustc/ty/layout.rs +++ b/src/librustc/ty/layout.rs @@ -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 { diff --git a/src/librustc_target/abi/mod.rs b/src/librustc_target/abi/mod.rs index d69b4b6d2bd..087d98d7031 100644 --- a/src/librustc_target/abi/mod.rs +++ b/src/librustc_target/abi/mod.rs @@ -947,6 +947,11 @@ pub trait TyLayoutMethods<'a, C: LayoutOf>: Sized { offset: Size, param_env: Self::ParamEnv, ) -> Option; + 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::pointee_info_at(self, cx, offset, param_env) } + pub fn is_freeze(self, cx: &C, param_env: Ty::ParamEnv) -> bool + where Ty: TyLayoutMethods<'a, C>, C: LayoutOf { + Ty::is_freeze(self, cx, param_env) + } } impl<'a, Ty> TyLayout<'a, Ty> {