1
Fork 0

Make ConstMethods and StaticMethods require BackendTypes instead of Backend

This commit is contained in:
bjorn3 2018-11-24 14:12:15 +01:00
parent b3b6e4dd9b
commit 436eff5e84
4 changed files with 7 additions and 7 deletions

View file

@ -171,7 +171,7 @@ pub fn ptrcast(val: &'ll Value, ty: &'ll Type) -> &'ll Value {
}
}
impl StaticMethods<'tcx> for CodegenCx<'ll, 'tcx> {
impl StaticMethods for CodegenCx<'ll, 'tcx> {
fn static_ptrcast(&self, val: &'ll Value, ty: &'ll Type) -> &'ll Value {
ptrcast(val, ty)

View file

@ -8,14 +8,14 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use super::Backend;
use super::BackendTypes;
use mir::place::PlaceRef;
use rustc::mir::interpret::Allocation;
use rustc::mir::interpret::Scalar;
use rustc::ty::layout;
use syntax::symbol::LocalInternedString;
pub trait ConstMethods<'tcx>: Backend<'tcx> {
pub trait ConstMethods<'tcx>: BackendTypes {
// Constant constructors
fn const_null(&self, t: Self::Type) -> Self::Value;

View file

@ -62,7 +62,7 @@ pub trait CodegenMethods<'tcx>:
+ TypeMethods<'tcx>
+ MiscMethods<'tcx>
+ ConstMethods<'tcx>
+ StaticMethods<'tcx>
+ StaticMethods
+ DebugInfoMethods<'tcx>
+ AbiMethods<'tcx>
+ IntrinsicDeclarationMethods<'tcx>
@ -77,7 +77,7 @@ impl<'tcx, T> CodegenMethods<'tcx> for T where
+ TypeMethods<'tcx>
+ MiscMethods<'tcx>
+ ConstMethods<'tcx>
+ StaticMethods<'tcx>
+ StaticMethods
+ DebugInfoMethods<'tcx>
+ AbiMethods<'tcx>
+ IntrinsicDeclarationMethods<'tcx>

View file

@ -8,11 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use super::Backend;
use super::BackendTypes;
use rustc::hir::def_id::DefId;
use rustc::ty::layout::Align;
pub trait StaticMethods<'tcx>: Backend<'tcx> {
pub trait StaticMethods: BackendTypes {
fn static_ptrcast(&self, val: Self::Value, ty: Self::Type) -> Self::Value;
fn static_bitcast(&self, val: Self::Value, ty: Self::Type) -> Self::Value;
fn static_addr_of_mut(&self, cv: Self::Value, align: Align, kind: Option<&str>) -> Self::Value;