mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-06 04:08:40 +00:00
Rustup to rustc 1.37.0-nightly (0dc9e9c10
2019-06-15)
This commit is contained in:
parent
80ab0cac3c
commit
4d406cdcad
@ -1,23 +0,0 @@
|
|||||||
From e5f840ecb5093e4f5e96f76119d5e3b733e660f3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ralf Jung <post@ralfj.de>
|
|
||||||
Date: Fri, 14 Jun 2019 11:00:37 +0200
|
|
||||||
Subject: [PATCH] make sure we use cfg-if as a std dependency
|
|
||||||
|
|
||||||
---
|
|
||||||
src/libstd/Cargo.toml | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/libstd/Cargo.toml b/src/libstd/Cargo.toml
|
|
||||||
index a170dae2b08c..38df1f26d95f 100644
|
|
||||||
--- a/src/libstd/Cargo.toml
|
|
||||||
+++ b/src/libstd/Cargo.toml
|
|
||||||
@@ -15,7 +15,7 @@ crate-type = ["dylib", "rlib"]
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
alloc = { path = "../liballoc" }
|
|
||||||
-cfg-if = "0.1.8"
|
|
||||||
+cfg-if = { version = "0.1.8", features = ['rustc-dep-of-std'] }
|
|
||||||
panic_unwind = { path = "../libpanic_unwind", optional = true }
|
|
||||||
panic_abort = { path = "../libpanic_abort" }
|
|
||||||
core = { path = "../libcore" }
|
|
||||||
|
|
@ -40,7 +40,7 @@ pub fn scalar_to_clif_type(tcx: TyCtxt, scalar: Scalar) -> Type {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_pass_mode<'tcx>(
|
fn get_pass_mode<'tcx>(
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
ty: Ty<'tcx>,
|
ty: Ty<'tcx>,
|
||||||
) -> PassMode {
|
) -> PassMode {
|
||||||
let layout = tcx.layout_of(ParamEnv::reveal_all().and(ty)).unwrap();
|
let layout = tcx.layout_of(ParamEnv::reveal_all().and(ty)).unwrap();
|
||||||
@ -76,7 +76,7 @@ fn adjust_arg_for_abi<'a, 'tcx: 'a>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn clif_sig_from_fn_sig<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, sig: FnSig<'tcx>) -> Signature {
|
fn clif_sig_from_fn_sig<'tcx>(tcx: TyCtxt<'tcx>, sig: FnSig<'tcx>) -> Signature {
|
||||||
let (call_conv, inputs, output): (CallConv, Vec<Ty>, Ty) = match sig.abi {
|
let (call_conv, inputs, output): (CallConv, Vec<Ty>, Ty) = match sig.abi {
|
||||||
Abi::Rust => (CallConv::SystemV, sig.inputs().to_vec(), sig.output()),
|
Abi::Rust => (CallConv::SystemV, sig.inputs().to_vec(), sig.output()),
|
||||||
Abi::C => (CallConv::SystemV, sig.inputs().to_vec(), sig.output()),
|
Abi::C => (CallConv::SystemV, sig.inputs().to_vec(), sig.output()),
|
||||||
@ -129,7 +129,7 @@ fn clif_sig_from_fn_sig<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, sig: FnSig<'tcx>) -> Sign
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_function_name_and_sig<'tcx>(
|
pub fn get_function_name_and_sig<'tcx>(
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
inst: Instance<'tcx>,
|
inst: Instance<'tcx>,
|
||||||
support_vararg: bool,
|
support_vararg: bool,
|
||||||
) -> (String, Signature) {
|
) -> (String, Signature) {
|
||||||
@ -144,7 +144,7 @@ pub fn get_function_name_and_sig<'tcx>(
|
|||||||
|
|
||||||
/// Instance must be monomorphized
|
/// Instance must be monomorphized
|
||||||
pub fn import_function<'tcx>(
|
pub fn import_function<'tcx>(
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
module: &mut Module<impl Backend>,
|
module: &mut Module<impl Backend>,
|
||||||
inst: Instance<'tcx>,
|
inst: Instance<'tcx>,
|
||||||
) -> FuncId {
|
) -> FuncId {
|
||||||
|
@ -18,7 +18,7 @@ pub fn trans_fn<'a, 'clif, 'tcx: 'a, B: Backend + 'static>(
|
|||||||
// Check sig for u128 and i128
|
// Check sig for u128 and i128
|
||||||
let fn_sig = tcx.normalize_erasing_late_bound_regions(ParamEnv::reveal_all(), &instance.fn_sig(tcx));
|
let fn_sig = tcx.normalize_erasing_late_bound_regions(ParamEnv::reveal_all(), &instance.fn_sig(tcx));
|
||||||
|
|
||||||
struct UI128Visitor<'tcx>(TyCtxt<'tcx, 'tcx>, bool);
|
struct UI128Visitor<'tcx>(TyCtxt<'tcx>, bool);
|
||||||
|
|
||||||
impl<'tcx> rustc::ty::fold::TypeVisitor<'tcx> for UI128Visitor<'tcx> {
|
impl<'tcx> rustc::ty::fold::TypeVisitor<'tcx> for UI128Visitor<'tcx> {
|
||||||
fn visit_ty(&mut self, t: Ty<'tcx>) -> bool {
|
fn visit_ty(&mut self, t: Ty<'tcx>) -> bool {
|
||||||
|
@ -17,8 +17,8 @@ pub fn pointer_ty(tcx: TyCtxt) -> types::Type {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn clif_type_from_ty<'a, 'tcx: 'a>(
|
pub fn clif_type_from_ty<'tcx>(
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
ty: Ty<'tcx>,
|
ty: Ty<'tcx>,
|
||||||
) -> Option<types::Type> {
|
) -> Option<types::Type> {
|
||||||
Some(match ty.sty {
|
Some(match ty.sty {
|
||||||
@ -95,7 +95,7 @@ pub fn clif_intcast<'a, 'tcx: 'a>(
|
|||||||
|
|
||||||
pub struct FunctionCx<'a, 'tcx: 'a, B: Backend> {
|
pub struct FunctionCx<'a, 'tcx: 'a, B: Backend> {
|
||||||
// FIXME use a reference to `CodegenCx` instead of `tcx`, `module` and `constants` and `caches`
|
// FIXME use a reference to `CodegenCx` instead of `tcx`, `module` and `constants` and `caches`
|
||||||
pub tcx: TyCtxt<'tcx, 'tcx>,
|
pub tcx: TyCtxt<'tcx>,
|
||||||
pub module: &'a mut Module<B>,
|
pub module: &'a mut Module<B>,
|
||||||
pub pointer_type: Type, // Cached from module
|
pub pointer_type: Type, // Cached from module
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ impl<'a, 'tcx: 'a, B: Backend> LayoutOf for FunctionCx<'a, 'tcx, B> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'tcx, B: Backend + 'a> layout::HasTyCtxt<'tcx> for FunctionCx<'a, 'tcx, B> {
|
impl<'a, 'tcx, B: Backend + 'a> layout::HasTyCtxt<'tcx> for FunctionCx<'a, 'tcx, B> {
|
||||||
fn tcx<'b>(&'b self) -> TyCtxt<'tcx, 'tcx> {
|
fn tcx<'b>(&'b self) -> TyCtxt<'tcx> {
|
||||||
self.tcx
|
self.tcx
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,10 +26,10 @@ enum TodoItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl ConstantCx {
|
impl ConstantCx {
|
||||||
pub fn finalize<'a, 'tcx: 'a, B: Backend>(
|
pub fn finalize(
|
||||||
mut self,
|
mut self,
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'_>,
|
||||||
module: &mut Module<B>,
|
module: &mut Module<impl Backend>,
|
||||||
) {
|
) {
|
||||||
//println!("todo {:?}", self.todo);
|
//println!("todo {:?}", self.todo);
|
||||||
define_all_allocs(tcx, module, &mut self);
|
define_all_allocs(tcx, module, &mut self);
|
||||||
@ -38,7 +38,7 @@ impl ConstantCx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn codegen_static<'a, 'tcx: 'a>(ccx: &mut ConstantCx, def_id: DefId) {
|
pub fn codegen_static(ccx: &mut ConstantCx, def_id: DefId) {
|
||||||
ccx.todo.insert(TodoItem::Static(def_id));
|
ccx.todo.insert(TodoItem::Static(def_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,15 +177,15 @@ fn trans_const_place<'a, 'tcx: 'a>(
|
|||||||
cplace_for_dataid(fx, const_.ty, data_id)
|
cplace_for_dataid(fx, const_.ty, data_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn data_id_for_alloc_id<B: Backend>(module: &mut Module<B>, alloc_id: AllocId) -> DataId {
|
fn data_id_for_alloc_id(module: &mut Module<impl Backend>, alloc_id: AllocId) -> DataId {
|
||||||
module
|
module
|
||||||
.declare_data(&format!("__alloc_{}", alloc_id.0), Linkage::Local, false, None)
|
.declare_data(&format!("__alloc_{}", alloc_id.0), Linkage::Local, false, None)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn data_id_for_static<'a, 'tcx: 'a, B: Backend>(
|
fn data_id_for_static(
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'_>,
|
||||||
module: &mut Module<B>,
|
module: &mut Module<impl Backend>,
|
||||||
def_id: DefId,
|
def_id: DefId,
|
||||||
linkage: Linkage,
|
linkage: Linkage,
|
||||||
) -> DataId {
|
) -> DataId {
|
||||||
@ -237,9 +237,9 @@ fn cplace_for_dataid<'a, 'tcx: 'a>(
|
|||||||
CPlace::for_addr(global_ptr, layout)
|
CPlace::for_addr(global_ptr, layout)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn define_all_allocs<'a, 'tcx: 'a, B: Backend + 'a>(
|
fn define_all_allocs(
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'_>,
|
||||||
module: &mut Module<B>,
|
module: &mut Module<impl Backend>,
|
||||||
cx: &mut ConstantCx,
|
cx: &mut ConstantCx,
|
||||||
) {
|
) {
|
||||||
let memory = Memory::<TransPlaceInterpreter>::new(tcx.at(DUMMY_SP));
|
let memory = Memory::<TransPlaceInterpreter>::new(tcx.at(DUMMY_SP));
|
||||||
@ -374,7 +374,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for TransPlaceInterpreter {
|
|||||||
|
|
||||||
fn find_foreign_static(
|
fn find_foreign_static(
|
||||||
_: DefId,
|
_: DefId,
|
||||||
_: ::rustc::ty::query::TyCtxtAt<'tcx, 'tcx>,
|
_: ::rustc::ty::query::TyCtxtAt<'tcx>,
|
||||||
) -> InterpResult<'tcx, Cow<'tcx, Allocation>> {
|
) -> InterpResult<'tcx, Cow<'tcx, Allocation>> {
|
||||||
panic!();
|
panic!();
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ pub struct DebugContext<'tcx> {
|
|||||||
_dummy: PhantomData<&'tcx ()>,
|
_dummy: PhantomData<&'tcx ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'tcx: 'a> DebugContext<'tcx> {
|
impl<'tcx> DebugContext<'tcx> {
|
||||||
pub fn new(tcx: TyCtxt, address_size: u8) -> Self {
|
pub fn new(tcx: TyCtxt, address_size: u8) -> Self {
|
||||||
let encoding = Encoding {
|
let encoding = Encoding {
|
||||||
format: Format::Dwarf32,
|
format: Format::Dwarf32,
|
||||||
@ -155,7 +155,7 @@ impl<'a, 'tcx: 'a> DebugContext<'tcx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn emit_location(&mut self, tcx: TyCtxt<'tcx, 'tcx>, entry_id: UnitEntryId, span: Span) {
|
fn emit_location(&mut self, tcx: TyCtxt<'tcx>, entry_id: UnitEntryId, span: Span) {
|
||||||
let loc = tcx.sess.source_map().lookup_char_pos(span.lo());
|
let loc = tcx.sess.source_map().lookup_char_pos(span.lo());
|
||||||
|
|
||||||
let file_id = line_program_add_file(
|
let file_id = line_program_add_file(
|
||||||
@ -230,9 +230,9 @@ pub struct FunctionDebugContext<'a, 'tcx> {
|
|||||||
mir_span: Span,
|
mir_span: Span,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'b, 'tcx: 'b> FunctionDebugContext<'a, 'tcx> {
|
impl<'a, 'tcx> FunctionDebugContext<'a, 'tcx> {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
debug_context: &'a mut DebugContext<'tcx>,
|
debug_context: &'a mut DebugContext<'tcx>,
|
||||||
mir: &Body,
|
mir: &Body,
|
||||||
name: &str,
|
name: &str,
|
||||||
|
@ -13,8 +13,8 @@ use cranelift_faerie::*;
|
|||||||
|
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
|
|
||||||
pub fn codegen_crate<'a, 'tcx>(
|
pub fn codegen_crate(
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'_>,
|
||||||
metadata: EncodedMetadata,
|
metadata: EncodedMetadata,
|
||||||
need_metadata_module: bool,
|
need_metadata_module: bool,
|
||||||
) -> Box<dyn Any> {
|
) -> Box<dyn Any> {
|
||||||
@ -45,7 +45,7 @@ pub fn codegen_crate<'a, 'tcx>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
fn run_jit<'a, 'tcx: 'a>(tcx: TyCtxt<'tcx, 'tcx>, log: &mut Option<File>) -> ! {
|
fn run_jit(tcx: TyCtxt<'_>, log: &mut Option<File>) -> ! {
|
||||||
use cranelift_simplejit::{SimpleJITBackend, SimpleJITBuilder};
|
use cranelift_simplejit::{SimpleJITBackend, SimpleJITBuilder};
|
||||||
|
|
||||||
let mut jit_module: Module<SimpleJITBackend> = Module::new(SimpleJITBuilder::new(
|
let mut jit_module: Module<SimpleJITBackend> = Module::new(SimpleJITBuilder::new(
|
||||||
@ -95,8 +95,8 @@ fn run_jit<'a, 'tcx: 'a>(tcx: TyCtxt<'tcx, 'tcx>, log: &mut Option<File>) -> ! {
|
|||||||
std::process::exit(ret);
|
std::process::exit(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run_aot<'a, 'tcx: 'a>(
|
fn run_aot(
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'_>,
|
||||||
metadata: EncodedMetadata,
|
metadata: EncodedMetadata,
|
||||||
need_metadata_module: bool,
|
need_metadata_module: bool,
|
||||||
log: &mut Option<File>,
|
log: &mut Option<File>,
|
||||||
@ -224,8 +224,8 @@ fn run_aot<'a, 'tcx: 'a>(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn codegen_cgus<'a, 'tcx: 'a>(
|
fn codegen_cgus<'tcx>(
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
module: &mut Module<impl Backend + 'static>,
|
module: &mut Module<impl Backend + 'static>,
|
||||||
debug: &mut Option<DebugContext<'tcx>>,
|
debug: &mut Option<DebugContext<'tcx>>,
|
||||||
log: &mut Option<File>,
|
log: &mut Option<File>,
|
||||||
@ -242,8 +242,8 @@ fn codegen_cgus<'a, 'tcx: 'a>(
|
|||||||
crate::main_shim::maybe_create_entry_wrapper(tcx, module);
|
crate::main_shim::maybe_create_entry_wrapper(tcx, module);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn codegen_mono_items<'a, 'tcx: 'a>(
|
fn codegen_mono_items<'tcx>(
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
module: &mut Module<impl Backend + 'static>,
|
module: &mut Module<impl Backend + 'static>,
|
||||||
debug_context: Option<&mut DebugContext<'tcx>>,
|
debug_context: Option<&mut DebugContext<'tcx>>,
|
||||||
log: &mut Option<File>,
|
log: &mut Option<File>,
|
||||||
@ -262,7 +262,7 @@ fn codegen_mono_items<'a, 'tcx: 'a>(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn trans_mono_item<'a, 'clif, 'tcx: 'a, B: Backend + 'static>(
|
fn trans_mono_item<'clif, 'tcx, B: Backend + 'static>(
|
||||||
cx: &mut crate::CodegenCx<'clif, 'tcx, B>,
|
cx: &mut crate::CodegenCx<'clif, 'tcx, B>,
|
||||||
mono_item: MonoItem<'tcx>,
|
mono_item: MonoItem<'tcx>,
|
||||||
linkage: Linkage,
|
linkage: Linkage,
|
||||||
|
10
src/lib.rs
10
src/lib.rs
@ -113,7 +113,7 @@ pub struct Caches<'tcx> {
|
|||||||
pub vtables: HashMap<(Ty<'tcx>, Option<ty::PolyExistentialTraitRef<'tcx>>), DataId>,
|
pub vtables: HashMap<(Ty<'tcx>, Option<ty::PolyExistentialTraitRef<'tcx>>), DataId>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> Default for Caches<'tcx> {
|
impl Default for Caches<'_> {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Caches {
|
Caches {
|
||||||
context: Context::new(),
|
context: Context::new(),
|
||||||
@ -123,7 +123,7 @@ impl<'tcx> Default for Caches<'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub struct CodegenCx<'clif, 'tcx, B: Backend + 'static> {
|
pub struct CodegenCx<'clif, 'tcx, B: Backend + 'static> {
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
module: &'clif mut Module<B>,
|
module: &'clif mut Module<B>,
|
||||||
ccx: ConstantCx,
|
ccx: ConstantCx,
|
||||||
caches: Caches<'tcx>,
|
caches: Caches<'tcx>,
|
||||||
@ -132,7 +132,7 @@ pub struct CodegenCx<'clif, 'tcx, B: Backend + 'static> {
|
|||||||
|
|
||||||
impl<'clif, 'tcx, B: Backend + 'static> CodegenCx<'clif, 'tcx, B> {
|
impl<'clif, 'tcx, B: Backend + 'static> CodegenCx<'clif, 'tcx, B> {
|
||||||
fn new(
|
fn new(
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
module: &'clif mut Module<B>,
|
module: &'clif mut Module<B>,
|
||||||
debug_context: Option<&'clif mut DebugContext<'tcx>>,
|
debug_context: Option<&'clif mut DebugContext<'tcx>>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
@ -193,9 +193,9 @@ impl CodegenBackend for CraneliftCodegenBackend {
|
|||||||
rustc_codegen_ssa::back::symbol_export::provide_extern(providers);
|
rustc_codegen_ssa::back::symbol_export::provide_extern(providers);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn codegen_crate<'a, 'tcx>(
|
fn codegen_crate<'tcx>(
|
||||||
&self,
|
&self,
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
metadata: EncodedMetadata,
|
metadata: EncodedMetadata,
|
||||||
need_metadata_module: bool,
|
need_metadata_module: bool,
|
||||||
_rx: mpsc::Receiver<Box<dyn Any + Send>>,
|
_rx: mpsc::Receiver<Box<dyn Any + Send>>,
|
||||||
|
@ -2,8 +2,8 @@ use crate::prelude::*;
|
|||||||
|
|
||||||
/// Create the `main` function which will initialize the rust runtime and call
|
/// Create the `main` function which will initialize the rust runtime and call
|
||||||
/// users main function.
|
/// users main function.
|
||||||
pub fn maybe_create_entry_wrapper<'a, 'tcx: 'a>(
|
pub fn maybe_create_entry_wrapper(
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'_>,
|
||||||
module: &mut Module<impl Backend + 'static>,
|
module: &mut Module<impl Backend + 'static>,
|
||||||
) {
|
) {
|
||||||
use rustc::middle::lang_items::StartFnLangItem;
|
use rustc::middle::lang_items::StartFnLangItem;
|
||||||
@ -22,8 +22,8 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx: 'a>(
|
|||||||
|
|
||||||
create_entry_fn(tcx, module, main_def_id, use_start_lang_item);;
|
create_entry_fn(tcx, module, main_def_id, use_start_lang_item);;
|
||||||
|
|
||||||
fn create_entry_fn<'a, 'tcx: 'a>(
|
fn create_entry_fn(
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'_>,
|
||||||
m: &mut Module<impl Backend + 'static>,
|
m: &mut Module<impl Backend + 'static>,
|
||||||
rust_main_def_id: DefId,
|
rust_main_def_id: DefId,
|
||||||
use_start_lang_item: bool,
|
use_start_lang_item: bool,
|
||||||
|
@ -48,8 +48,8 @@ impl MetadataLoader for CraneliftMetadataLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adapted from https://github.com/rust-lang/rust/blob/da573206f87b5510de4b0ee1a9c044127e409bd3/src/librustc_codegen_llvm/base.rs#L47-L112
|
// Adapted from https://github.com/rust-lang/rust/blob/da573206f87b5510de4b0ee1a9c044127e409bd3/src/librustc_codegen_llvm/base.rs#L47-L112
|
||||||
pub fn write_metadata<'a, 'gcx>(
|
pub fn write_metadata(
|
||||||
tcx: TyCtxt<'gcx, 'gcx>,
|
tcx: TyCtxt<'_>,
|
||||||
artifact: &mut faerie::Artifact
|
artifact: &mut faerie::Artifact
|
||||||
) -> EncodedMetadata {
|
) -> EncodedMetadata {
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
@ -77,7 +77,7 @@ pub struct CommentWriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl CommentWriter {
|
impl CommentWriter {
|
||||||
pub fn new<'a, 'tcx: 'a>(tcx: TyCtxt<'tcx, 'tcx>, instance: Instance<'tcx>) -> Self {
|
pub fn new<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) -> Self {
|
||||||
CommentWriter {
|
CommentWriter {
|
||||||
global_comments: vec![
|
global_comments: vec![
|
||||||
format!("symbol {}", tcx.symbol_name(instance).as_str()),
|
format!("symbol {}", tcx.symbol_name(instance).as_str()),
|
||||||
@ -91,7 +91,7 @@ impl CommentWriter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> FuncWriter for &'a CommentWriter {
|
impl FuncWriter for &'_ CommentWriter {
|
||||||
fn write_preamble(
|
fn write_preamble(
|
||||||
&mut self,
|
&mut self,
|
||||||
w: &mut dyn fmt::Write,
|
w: &mut dyn fmt::Write,
|
||||||
@ -193,8 +193,8 @@ impl<'a, 'tcx: 'a, B: Backend + 'a> FunctionCx<'a, 'tcx, B> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_clif_file<'a, 'tcx: 'a>(
|
pub fn write_clif_file<'tcx>(
|
||||||
tcx: TyCtxt<'tcx, 'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
postfix: &str,
|
postfix: &str,
|
||||||
instance: Instance<'tcx>,
|
instance: Instance<'tcx>,
|
||||||
func: &ir::Function,
|
func: &ir::Function,
|
||||||
|
Loading…
Reference in New Issue
Block a user