From b710c0d48ce8d5873441a8078dcf992c1d951ac8 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Mon, 30 Aug 2021 17:38:27 +0300 Subject: [PATCH] rustc_target: move `LayoutOf` to `ty::layout`. --- src/common.rs | 6 ++---- src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/common.rs b/src/common.rs index 03f462a63b31..6ba03f0340cc 100644 --- a/src/common.rs +++ b/src/common.rs @@ -257,8 +257,7 @@ pub(crate) struct FunctionCx<'m, 'clif, 'tcx: 'm> { } impl<'tcx> LayoutOf<'tcx> for FunctionCx<'_, '_, 'tcx> { - type Ty = Ty<'tcx>; - type TyAndLayout = TyAndLayout<'tcx>; + type LayoutOfResult = TyAndLayout<'tcx>; fn layout_of(&self, ty: Ty<'tcx>) -> TyAndLayout<'tcx> { RevealAllLayoutCx(self.tcx).layout_of(ty) @@ -365,8 +364,7 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> { pub(crate) struct RevealAllLayoutCx<'tcx>(pub(crate) TyCtxt<'tcx>); impl<'tcx> LayoutOf<'tcx> for RevealAllLayoutCx<'tcx> { - type Ty = Ty<'tcx>; - type TyAndLayout = TyAndLayout<'tcx>; + type LayoutOfResult = TyAndLayout<'tcx>; fn layout_of(&self, ty: Ty<'tcx>) -> TyAndLayout<'tcx> { assert!(!ty.still_further_specializable()); diff --git a/src/lib.rs b/src/lib.rs index 4ef53663ca0d..34cd309d26f3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -79,12 +79,12 @@ mod prelude { pub(crate) use rustc_hir::def_id::{DefId, LOCAL_CRATE}; pub(crate) use rustc_middle::bug; 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::{ self, FloatTy, Instance, InstanceDef, IntTy, ParamEnv, Ty, TyCtxt, TypeAndMut, 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;