Generalized base::unsized_info

This commit is contained in:
Denis Merigoux
2018-09-13 14:58:19 +02:00
committed by Eduard-Mihai Burtescu
parent 484e07c231
commit 034f69753b
26 changed files with 338 additions and 287 deletions

View File

@@ -8,11 +8,22 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use rustc::ty::layout::{HasTyCtxt, LayoutOf, TyLayout};
use rustc::ty::Ty;
use std::fmt::Debug;
pub trait Backend {
pub trait BackendTypes {
type Value: Debug + PartialEq + Copy;
type BasicBlock;
type Type: Debug + PartialEq + Copy;
type Context;
}
pub trait Backend<'tcx>:
BackendTypes + HasTyCtxt<'tcx> + LayoutOf<Ty = Ty<'tcx>, TyLayout = TyLayout<'tcx>>
{
}
impl<'tcx, T> Backend<'tcx> for T where
Self: BackendTypes + HasTyCtxt<'tcx> + LayoutOf<Ty = Ty<'tcx>, TyLayout = TyLayout<'tcx>>
{}