Rustup to rustc 1.37.0-nightly (0dc9e9c10 2019-06-15)

This commit is contained in:
bjorn3 2019-06-16 11:13:49 +02:00
parent 80ab0cac3c
commit 4d406cdcad
11 changed files with 50 additions and 73 deletions

View File

@ -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" }

View File

@ -40,7 +40,7 @@ pub fn scalar_to_clif_type(tcx: TyCtxt, scalar: Scalar) -> Type {
}
fn get_pass_mode<'tcx>(
tcx: TyCtxt<'tcx, 'tcx>,
tcx: TyCtxt<'tcx>,
ty: Ty<'tcx>,
) -> PassMode {
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 {
Abi::Rust => (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>(
tcx: TyCtxt<'tcx, 'tcx>,
tcx: TyCtxt<'tcx>,
inst: Instance<'tcx>,
support_vararg: bool,
) -> (String, Signature) {
@ -144,7 +144,7 @@ pub fn get_function_name_and_sig<'tcx>(
/// Instance must be monomorphized
pub fn import_function<'tcx>(
tcx: TyCtxt<'tcx, 'tcx>,
tcx: TyCtxt<'tcx>,
module: &mut Module<impl Backend>,
inst: Instance<'tcx>,
) -> FuncId {

View File

@ -18,7 +18,7 @@ pub fn trans_fn<'a, 'clif, 'tcx: 'a, B: Backend + 'static>(
// Check sig for u128 and i128
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> {
fn visit_ty(&mut self, t: Ty<'tcx>) -> bool {

View File

@ -17,8 +17,8 @@ pub fn pointer_ty(tcx: TyCtxt) -> types::Type {
}
}
pub fn clif_type_from_ty<'a, 'tcx: 'a>(
tcx: TyCtxt<'tcx, 'tcx>,
pub fn clif_type_from_ty<'tcx>(
tcx: TyCtxt<'tcx>,
ty: Ty<'tcx>,
) -> Option<types::Type> {
Some(match ty.sty {
@ -95,7 +95,7 @@ pub fn clif_intcast<'a, 'tcx: 'a>(
pub struct FunctionCx<'a, 'tcx: 'a, B: Backend> {
// 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 pointer_type: Type, // Cached from module
@ -123,7 +123,7 @@ fn layout_of(&self, ty: Ty<'tcx>) -> TyLayout<'tcx> {
}
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
}
}

View File

@ -26,10 +26,10 @@ enum TodoItem {
}
impl ConstantCx {
pub fn finalize<'a, 'tcx: 'a, B: Backend>(
pub fn finalize(
mut self,
tcx: TyCtxt<'tcx, 'tcx>,
module: &mut Module<B>,
tcx: TyCtxt<'_>,
module: &mut Module<impl Backend>,
) {
//println!("todo {:?}", self.todo);
define_all_allocs(tcx, module, &mut self);
@ -38,7 +38,7 @@ pub fn finalize<'a, 'tcx: 'a, B: Backend>(
}
}
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));
}
@ -177,15 +177,15 @@ fn trans_const_place<'a, 'tcx: 'a>(
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
.declare_data(&format!("__alloc_{}", alloc_id.0), Linkage::Local, false, None)
.unwrap()
}
fn data_id_for_static<'a, 'tcx: 'a, B: Backend>(
tcx: TyCtxt<'tcx, 'tcx>,
module: &mut Module<B>,
fn data_id_for_static(
tcx: TyCtxt<'_>,
module: &mut Module<impl Backend>,
def_id: DefId,
linkage: Linkage,
) -> DataId {
@ -237,9 +237,9 @@ fn cplace_for_dataid<'a, 'tcx: 'a>(
CPlace::for_addr(global_ptr, layout)
}
fn define_all_allocs<'a, 'tcx: 'a, B: Backend + 'a>(
tcx: TyCtxt<'tcx, 'tcx>,
module: &mut Module<B>,
fn define_all_allocs(
tcx: TyCtxt<'_>,
module: &mut Module<impl Backend>,
cx: &mut ConstantCx,
) {
let memory = Memory::<TransPlaceInterpreter>::new(tcx.at(DUMMY_SP));
@ -374,7 +374,7 @@ fn call_intrinsic(
fn find_foreign_static(
_: DefId,
_: ::rustc::ty::query::TyCtxtAt<'tcx, 'tcx>,
_: ::rustc::ty::query::TyCtxtAt<'tcx>,
) -> InterpResult<'tcx, Cow<'tcx, Allocation>> {
panic!();
}

View File

@ -92,7 +92,7 @@ pub struct DebugContext<'tcx> {
_dummy: PhantomData<&'tcx ()>,
}
impl<'a, 'tcx: 'a> DebugContext<'tcx> {
impl<'tcx> DebugContext<'tcx> {
pub fn new(tcx: TyCtxt, address_size: u8) -> Self {
let encoding = Encoding {
format: Format::Dwarf32,
@ -155,7 +155,7 @@ pub fn new(tcx: TyCtxt, address_size: u8) -> Self {
}
}
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 file_id = line_program_add_file(
@ -230,9 +230,9 @@ pub struct FunctionDebugContext<'a, 'tcx> {
mir_span: Span,
}
impl<'a, 'b, 'tcx: 'b> FunctionDebugContext<'a, 'tcx> {
impl<'a, 'tcx> FunctionDebugContext<'a, 'tcx> {
pub fn new(
tcx: TyCtxt<'tcx, 'tcx>,
tcx: TyCtxt<'tcx>,
debug_context: &'a mut DebugContext<'tcx>,
mir: &Body,
name: &str,

View File

@ -13,8 +13,8 @@
use crate::prelude::*;
pub fn codegen_crate<'a, 'tcx>(
tcx: TyCtxt<'tcx, 'tcx>,
pub fn codegen_crate(
tcx: TyCtxt<'_>,
metadata: EncodedMetadata,
need_metadata_module: bool,
) -> Box<dyn Any> {
@ -45,7 +45,7 @@ pub fn codegen_crate<'a, 'tcx>(
}
#[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};
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);
}
fn run_aot<'a, 'tcx: 'a>(
tcx: TyCtxt<'tcx, 'tcx>,
fn run_aot(
tcx: TyCtxt<'_>,
metadata: EncodedMetadata,
need_metadata_module: bool,
log: &mut Option<File>,
@ -224,8 +224,8 @@ fn run_aot<'a, 'tcx: 'a>(
})
}
fn codegen_cgus<'a, 'tcx: 'a>(
tcx: TyCtxt<'tcx, 'tcx>,
fn codegen_cgus<'tcx>(
tcx: TyCtxt<'tcx>,
module: &mut Module<impl Backend + 'static>,
debug: &mut Option<DebugContext<'tcx>>,
log: &mut Option<File>,
@ -242,8 +242,8 @@ fn codegen_cgus<'a, 'tcx: 'a>(
crate::main_shim::maybe_create_entry_wrapper(tcx, module);
}
fn codegen_mono_items<'a, 'tcx: 'a>(
tcx: TyCtxt<'tcx, 'tcx>,
fn codegen_mono_items<'tcx>(
tcx: TyCtxt<'tcx>,
module: &mut Module<impl Backend + 'static>,
debug_context: Option<&mut DebugContext<'tcx>>,
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>,
mono_item: MonoItem<'tcx>,
linkage: Linkage,

View File

@ -113,7 +113,7 @@ pub struct Caches<'tcx> {
pub vtables: HashMap<(Ty<'tcx>, Option<ty::PolyExistentialTraitRef<'tcx>>), DataId>,
}
impl<'tcx> Default for Caches<'tcx> {
impl Default for Caches<'_> {
fn default() -> Self {
Caches {
context: Context::new(),
@ -123,7 +123,7 @@ fn default() -> Self {
}
pub struct CodegenCx<'clif, 'tcx, B: Backend + 'static> {
tcx: TyCtxt<'tcx, 'tcx>,
tcx: TyCtxt<'tcx>,
module: &'clif mut Module<B>,
ccx: ConstantCx,
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> {
fn new(
tcx: TyCtxt<'tcx, 'tcx>,
tcx: TyCtxt<'tcx>,
module: &'clif mut Module<B>,
debug_context: Option<&'clif mut DebugContext<'tcx>>,
) -> Self {
@ -193,9 +193,9 @@ fn provide_extern(&self, providers: &mut Providers) {
rustc_codegen_ssa::back::symbol_export::provide_extern(providers);
}
fn codegen_crate<'a, 'tcx>(
fn codegen_crate<'tcx>(
&self,
tcx: TyCtxt<'tcx, 'tcx>,
tcx: TyCtxt<'tcx>,
metadata: EncodedMetadata,
need_metadata_module: bool,
_rx: mpsc::Receiver<Box<dyn Any + Send>>,

View File

@ -2,8 +2,8 @@
/// Create the `main` function which will initialize the rust runtime and call
/// users main function.
pub fn maybe_create_entry_wrapper<'a, 'tcx: 'a>(
tcx: TyCtxt<'tcx, 'tcx>,
pub fn maybe_create_entry_wrapper(
tcx: TyCtxt<'_>,
module: &mut Module<impl Backend + 'static>,
) {
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);;
fn create_entry_fn<'a, 'tcx: 'a>(
tcx: TyCtxt<'tcx, 'tcx>,
fn create_entry_fn(
tcx: TyCtxt<'_>,
m: &mut Module<impl Backend + 'static>,
rust_main_def_id: DefId,
use_start_lang_item: bool,

View File

@ -48,8 +48,8 @@ fn get_dylib_metadata(
}
// Adapted from https://github.com/rust-lang/rust/blob/da573206f87b5510de4b0ee1a9c044127e409bd3/src/librustc_codegen_llvm/base.rs#L47-L112
pub fn write_metadata<'a, 'gcx>(
tcx: TyCtxt<'gcx, 'gcx>,
pub fn write_metadata(
tcx: TyCtxt<'_>,
artifact: &mut faerie::Artifact
) -> EncodedMetadata {
use std::io::Write;

View File

@ -77,7 +77,7 @@ pub struct 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 {
global_comments: vec![
format!("symbol {}", tcx.symbol_name(instance).as_str()),
@ -91,7 +91,7 @@ pub fn new<'a, 'tcx: 'a>(tcx: TyCtxt<'tcx, 'tcx>, instance: Instance<'tcx>) -> S
}
}
impl<'a> FuncWriter for &'a CommentWriter {
impl FuncWriter for &'_ CommentWriter {
fn write_preamble(
&mut self,
w: &mut dyn fmt::Write,
@ -193,8 +193,8 @@ pub fn add_comment<'s, S: Into<Cow<'s, str>>>(&mut self, inst: Inst, comment: S)
}
}
pub fn write_clif_file<'a, 'tcx: 'a>(
tcx: TyCtxt<'tcx, 'tcx>,
pub fn write_clif_file<'tcx>(
tcx: TyCtxt<'tcx>,
postfix: &str,
instance: Instance<'tcx>,
func: &ir::Function,