rustc_target: move LayoutOf
to ty::layout
.
This commit is contained in:
parent
39e16da529
commit
b710c0d48c
2 changed files with 4 additions and 6 deletions
|
@ -257,8 +257,7 @@ pub(crate) struct FunctionCx<'m, 'clif, 'tcx: 'm> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> LayoutOf<'tcx> for FunctionCx<'_, '_, 'tcx> {
|
impl<'tcx> LayoutOf<'tcx> for FunctionCx<'_, '_, 'tcx> {
|
||||||
type Ty = Ty<'tcx>;
|
type LayoutOfResult = TyAndLayout<'tcx>;
|
||||||
type TyAndLayout = TyAndLayout<'tcx>;
|
|
||||||
|
|
||||||
fn layout_of(&self, ty: Ty<'tcx>) -> TyAndLayout<'tcx> {
|
fn layout_of(&self, ty: Ty<'tcx>) -> TyAndLayout<'tcx> {
|
||||||
RevealAllLayoutCx(self.tcx).layout_of(ty)
|
RevealAllLayoutCx(self.tcx).layout_of(ty)
|
||||||
|
@ -365,8 +364,7 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> {
|
||||||
pub(crate) struct RevealAllLayoutCx<'tcx>(pub(crate) TyCtxt<'tcx>);
|
pub(crate) struct RevealAllLayoutCx<'tcx>(pub(crate) TyCtxt<'tcx>);
|
||||||
|
|
||||||
impl<'tcx> LayoutOf<'tcx> for RevealAllLayoutCx<'tcx> {
|
impl<'tcx> LayoutOf<'tcx> for RevealAllLayoutCx<'tcx> {
|
||||||
type Ty = Ty<'tcx>;
|
type LayoutOfResult = TyAndLayout<'tcx>;
|
||||||
type TyAndLayout = TyAndLayout<'tcx>;
|
|
||||||
|
|
||||||
fn layout_of(&self, ty: Ty<'tcx>) -> TyAndLayout<'tcx> {
|
fn layout_of(&self, ty: Ty<'tcx>) -> TyAndLayout<'tcx> {
|
||||||
assert!(!ty.still_further_specializable());
|
assert!(!ty.still_further_specializable());
|
||||||
|
|
|
@ -79,12 +79,12 @@ mod prelude {
|
||||||
pub(crate) use rustc_hir::def_id::{DefId, LOCAL_CRATE};
|
pub(crate) use rustc_hir::def_id::{DefId, LOCAL_CRATE};
|
||||||
pub(crate) use rustc_middle::bug;
|
pub(crate) use rustc_middle::bug;
|
||||||
pub(crate) use rustc_middle::mir::{self, *};
|
pub(crate) use rustc_middle::mir::{self, *};
|
||||||
pub(crate) use rustc_middle::ty::layout::{self, TyAndLayout};
|
pub(crate) use rustc_middle::ty::layout::{self, LayoutOf, TyAndLayout};
|
||||||
pub(crate) use rustc_middle::ty::{
|
pub(crate) use rustc_middle::ty::{
|
||||||
self, FloatTy, Instance, InstanceDef, IntTy, ParamEnv, Ty, TyCtxt, TypeAndMut,
|
self, FloatTy, Instance, InstanceDef, IntTy, ParamEnv, Ty, TyCtxt, TypeAndMut,
|
||||||
TypeFoldable, UintTy,
|
TypeFoldable, UintTy,
|
||||||
};
|
};
|
||||||
pub(crate) use rustc_target::abi::{Abi, LayoutOf, Scalar, Size, VariantIdx};
|
pub(crate) use rustc_target::abi::{Abi, Scalar, Size, VariantIdx};
|
||||||
|
|
||||||
pub(crate) use rustc_data_structures::fx::FxHashMap;
|
pub(crate) use rustc_data_structures::fx::FxHashMap;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue