diff --git a/src/common.rs b/src/common.rs index 02e04f0d3eb..5093f324a0c 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1,5 +1,6 @@ use std::fmt; +use rustc_codegen_ssa::traits::BackendTypes; use rustc_target::spec::{HasTargetSpec, Target}; use cranelift_module::Module; @@ -667,6 +668,15 @@ fn target_spec(&self) -> &Target { } } +impl<'a, 'tcx, B: Backend> BackendTypes for FunctionCx<'a, 'tcx, B> { + type Value = Value; + type BasicBlock = Ebb; + type Type = Type; + type Context = !; + type Funclet = !; + type DIScope = !; +} + impl<'a, 'tcx: 'a, B: Backend + 'a> FunctionCx<'a, 'tcx, B> { pub fn monomorphize(&self, value: &T) -> T where diff --git a/src/lib.rs b/src/lib.rs index dbe3536ecfe..cfd41ba0648 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -76,7 +76,6 @@ mod prelude { self, subst::Substs, FnSig, Instance, InstanceDef, ParamEnv, PolyFnSig, Ty, TyCtxt, TypeAndMut, TypeFoldable, }; - pub use rustc_codegen_ssa::{CodegenResults, CompiledModule, ModuleKind}; pub use rustc_data_structures::{ fx::{FxHashMap, FxHashSet}, indexed_vec::Idx, @@ -84,6 +83,9 @@ mod prelude { }; pub use rustc_mir::monomorphize::{collector, MonoItem}; + pub use rustc_codegen_ssa::{CodegenResults, CompiledModule, ModuleKind}; + pub use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue}; + pub use cranelift::codegen::ir::{ condcodes::IntCC, function::Function, ExternalName, FuncRef, Inst, StackSlot, };