From 34823a7e4c9d13abe7b92056b3c76af7ef9336ec Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Fri, 17 Jul 2020 19:15:33 +0200 Subject: [PATCH] Rustup to rustc 1.46.0-nightly (5c9e5df3a 2020-07-16) --- ...-usage-of-extern_weak-in-thread_local_dtor.patch} | 12 ++++++------ rust-toolchain | 2 +- src/abi/mod.rs | 6 +++--- src/base.rs | 6 +++--- src/constant.rs | 10 +++++----- src/driver/aot.rs | 2 +- src/driver/mod.rs | 2 +- src/main_shim.rs | 2 +- src/pretty_clif.rs | 4 ++-- 9 files changed, 23 insertions(+), 23 deletions(-) rename patches/{0025-Remove-usage-of-extern_weak-in-fast_thread_local.patch => 0025-Remove-usage-of-extern_weak-in-thread_local_dtor.patch} (73%) diff --git a/patches/0025-Remove-usage-of-extern_weak-in-fast_thread_local.patch b/patches/0025-Remove-usage-of-extern_weak-in-thread_local_dtor.patch similarity index 73% rename from patches/0025-Remove-usage-of-extern_weak-in-fast_thread_local.patch rename to patches/0025-Remove-usage-of-extern_weak-in-thread_local_dtor.patch index 06f8301ae4d..0a25e6b3302 100644 --- a/patches/0025-Remove-usage-of-extern_weak-in-fast_thread_local.patch +++ b/patches/0025-Remove-usage-of-extern_weak-in-thread_local_dtor.patch @@ -1,22 +1,22 @@ From 7496bb94a2fb2bc34629c9781c3bc3a470becaee Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Fri, 10 Apr 2020 13:47:42 +0200 -Subject: [PATCH] Remove usage of extern_weak in fast_thread_local +Subject: [PATCH] Remove usage of extern_weak in thread_local_dtor --- - src/libstd/sys/unix/fast_thread_local.rs | 20 -------------------- + src/libstd/sys/unix/thread_local_dtor.rs | 20 -------------------- 1 files changed, 0 insertions(+), 20 deletions(-) -diff --git a/src/libstd/sys/unix/fast_thread_local.rs b/src/libstd/sys/unix/fast_thread_local.rs +diff --git a/src/libstd/sys/unix/thread_local_dtor.rs b/src/libstd/sys/unix/thread_local_dtor.rs index 8730b4d..8d6e3d5 100644 ---- a/src/libstd/sys/unix/fast_thread_local.rs -+++ b/src/libstd/sys/unix/fast_thread_local.rs +--- a/src/libstd/sys/unix/thread_local_dtor.rs ++++ b/src/libstd/sys/unix/thread_local_dtor.rs @@ -15,28 +15,8 @@ target_os = "emscripten" ))] pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) { - use crate::mem; - use crate::sys_common::thread_local::register_dtor_fallback; + use crate::sys_common::thread_local_dtor::register_dtor_fallback; - extern "C" { - #[linkage = "extern_weak"] diff --git a/rust-toolchain b/rust-toolchain index b5d2f817568..1903f2c25cd 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2020-07-13 +nightly-2020-07-17 diff --git a/src/abi/mod.rs b/src/abi/mod.rs index 1989b2b08b3..1b67f3d6f15 100644 --- a/src/abi/mod.rs +++ b/src/abi/mod.rs @@ -195,7 +195,7 @@ pub(crate) fn get_function_name_and_sig<'tcx>( tcx.sess.span_fatal(tcx.def_span(inst.def_id()), "Variadic function definitions are not yet supported"); } let sig = clif_sig_from_fn_sig(tcx, triple, fn_sig, tcx.def_span(inst.def_id()), false, inst.def.requires_caller_location(tcx)); - (tcx.symbol_name(inst).name.as_str().to_string(), sig) + (tcx.symbol_name(inst).name.to_string(), sig) } /// Instance must be monomorphized @@ -465,10 +465,10 @@ pub(crate) fn codegen_terminator_call<'tcx>( .unwrap() .unwrap(); - if fx.tcx.symbol_name(instance).name.as_str().starts_with("llvm.") { + if fx.tcx.symbol_name(instance).name.starts_with("llvm.") { crate::intrinsics::codegen_llvm_intrinsic_call( fx, - &fx.tcx.symbol_name(instance).name.as_str(), + &fx.tcx.symbol_name(instance).name, substs, args, destination, diff --git a/src/base.rs b/src/base.rs index 6d9867274ab..f7fdea65140 100644 --- a/src/base.rs +++ b/src/base.rs @@ -266,7 +266,7 @@ fn codegen_fn_content(fx: &mut FunctionCx<'_, '_, impl Backend>) { }); let instance = Instance::mono(fx.tcx, def_id); - let symbol_name = fx.tcx.symbol_name(instance).name.as_str(); + let symbol_name = fx.tcx.symbol_name(instance).name; fx.lib_call(&*symbol_name, vec![fx.pointer_type, fx.pointer_type, fx.pointer_type], vec![], &args); @@ -719,10 +719,10 @@ fn trans_stmt<'tcx>( crate::trap::trap_unimplemented(fx, "_xgetbv arch intrinsic is not supported"); } // ___chkstk, ___chkstk_ms and __alloca are only used on Windows - _ if fx.tcx.symbol_name(fx.instance).name.as_str().starts_with("___chkstk") => { + _ if fx.tcx.symbol_name(fx.instance).name.starts_with("___chkstk") => { crate::trap::trap_unimplemented(fx, "Stack probes are not supported"); } - _ if fx.tcx.symbol_name(fx.instance).name.as_str() == "__alloca" => { + _ if fx.tcx.symbol_name(fx.instance).name == "__alloca" => { crate::trap::trap_unimplemented(fx, "Alloca is not supported"); } // Used in sys::windows::abort_internal diff --git a/src/constant.rs b/src/constant.rs index 8a22ddefbb2..139dcb5988f 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -75,18 +75,18 @@ pub(crate) fn trans_constant<'tcx>( let const_ = fx.monomorphize(&constant.literal); let const_val = match const_.val { ConstKind::Value(const_val) => const_val, - ConstKind::Unevaluated(def_id, ref substs, promoted) if fx.tcx.is_static(def_id) => { + ConstKind::Unevaluated(def, ref substs, promoted) if fx.tcx.is_static(def.did) => { assert!(substs.is_empty()); assert!(promoted.is_none()); return codegen_static_ref( fx, - def_id, + def.did, fx.layout_of(fx.monomorphize(&constant.literal.ty)), ).to_cvalue(fx); } - ConstKind::Unevaluated(def_id, ref substs, promoted) => { - match fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), def_id, substs, promoted, None) { + ConstKind::Unevaluated(def, ref substs, promoted) => { + match fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), def, substs, promoted, None) { Ok(const_val) => const_val, Err(_) => { if promoted.is_none() { @@ -229,7 +229,7 @@ fn data_id_for_static( linkage: Linkage, ) -> DataId { let instance = Instance::mono(tcx, def_id); - let symbol_name = tcx.symbol_name(instance).name.as_str(); + let symbol_name = tcx.symbol_name(instance).name; let ty = instance.monomorphic_ty(tcx); let is_mutable = if tcx.is_mutable_static(def_id) { true diff --git a/src/driver/aot.rs b/src/driver/aot.rs index 38ca44c4bfb..d6d62598efb 100644 --- a/src/driver/aot.rs +++ b/src/driver/aot.rs @@ -122,7 +122,7 @@ fn module_codegen(tcx: TyCtxt<'_>, cgu_name: rustc_span::Symbol) -> ModuleCodege if mono_items.iter().any(|(mono_item, _)| { match mono_item { rustc_middle::mir::mono::MonoItem::Static(def_id) => { - tcx.symbol_name(Instance::mono(tcx, *def_id)).name.as_str().contains("__rustc_proc_macro_decls_") + tcx.symbol_name(Instance::mono(tcx, *def_id)).name.contains("__rustc_proc_macro_decls_") } _ => false, } diff --git a/src/driver/mod.rs b/src/driver/mod.rs index f8446cbeddd..1d81efb880d 100644 --- a/src/driver/mod.rs +++ b/src/driver/mod.rs @@ -62,7 +62,7 @@ fn trans_mono_item<'tcx, B: Backend + 'static>( match mono_item { MonoItem::Fn(inst) => { let _inst_guard = - crate::PrintOnPanic(|| format!("{:?} {}", inst, tcx.symbol_name(inst).name.as_str())); + crate::PrintOnPanic(|| format!("{:?} {}", inst, tcx.symbol_name(inst).name)); debug_assert!(!inst.substs.needs_infer()); let _mir_guard = crate::PrintOnPanic(|| { match inst.def { diff --git a/src/main_shim.rs b/src/main_shim.rs index 7366c6a9c0a..98148355b27 100644 --- a/src/main_shim.rs +++ b/src/main_shim.rs @@ -22,7 +22,7 @@ pub(crate) fn maybe_create_entry_wrapper( }; let instance = Instance::mono(tcx, main_def_id); - if module.get_name(&*tcx.symbol_name(instance).name.as_str()).is_none() { + if module.get_name(&*tcx.symbol_name(instance).name).is_none() { return; } diff --git a/src/pretty_clif.rs b/src/pretty_clif.rs index 8b1e611ef2f..0dcd2c269e8 100644 --- a/src/pretty_clif.rs +++ b/src/pretty_clif.rs @@ -74,7 +74,7 @@ impl CommentWriter { pub(crate) fn new<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) -> Self { let global_comments = if cfg!(debug_assertions) { vec![ - format!("symbol {}", tcx.symbol_name(instance).name.as_str()), + format!("symbol {}", tcx.symbol_name(instance).name), format!("instance {:?}", instance), format!( "sig {:?}", @@ -220,7 +220,7 @@ pub(crate) fn write_clif_file<'tcx>( .expect("value location ranges") }); - let symbol_name = tcx.symbol_name(instance).name.as_str(); + let symbol_name = tcx.symbol_name(instance).name; let clif_file_name = format!( "{}/{}__{}.{}.clif", concat!(env!("CARGO_MANIFEST_DIR"), "/target/out/clif"),