From afc0bb9794bfcbc9864a1d195ac34b892727f9e4 Mon Sep 17 00:00:00 2001 From: csmoe Date: Thu, 3 Oct 2019 21:51:30 +0800 Subject: clean up GeneratorSubsts --- src/librustc_codegen_utils/symbol_names/legacy.rs | 2 +- src/librustc_codegen_utils/symbol_names/v0.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/librustc_codegen_utils') diff --git a/src/librustc_codegen_utils/symbol_names/legacy.rs b/src/librustc_codegen_utils/symbol_names/legacy.rs index 5bcb3b4ceb3..cf575c54293 100644 --- a/src/librustc_codegen_utils/symbol_names/legacy.rs +++ b/src/librustc_codegen_utils/symbol_names/legacy.rs @@ -225,7 +225,7 @@ impl Printer<'tcx> for SymbolPrinter<'tcx> { ty::Projection(ty::ProjectionTy { item_def_id: def_id, substs }) | ty::UnnormalizedProjection(ty::ProjectionTy { item_def_id: def_id, substs }) | ty::Closure(def_id, substs) | - ty::Generator(def_id, ty::GeneratorSubsts { substs }, _) => { + ty::Generator(def_id, substs, _) => { self.print_def_path(def_id, substs) } _ => self.pretty_print_type(ty), diff --git a/src/librustc_codegen_utils/symbol_names/v0.rs b/src/librustc_codegen_utils/symbol_names/v0.rs index 2ad699d7c6f..55b148fceb2 100644 --- a/src/librustc_codegen_utils/symbol_names/v0.rs +++ b/src/librustc_codegen_utils/symbol_names/v0.rs @@ -415,7 +415,7 @@ impl Printer<'tcx> for SymbolMangler<'tcx> { ty::Projection(ty::ProjectionTy { item_def_id: def_id, substs }) | ty::UnnormalizedProjection(ty::ProjectionTy { item_def_id: def_id, substs }) | ty::Closure(def_id, substs) | - ty::Generator(def_id, ty::GeneratorSubsts { substs }, _) => { + ty::Generator(def_id, substs, _) => { self = self.print_def_path(def_id, substs)?; } ty::Foreign(def_id) => { -- cgit 1.4.1-3-g733a5 From 41d329c10d68d1ddefde134d6c276d384a68d1a1 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 12 Oct 2019 12:36:48 +0200 Subject: Remove unused method CodegenBackend::diagnostics --- src/librustc_codegen_llvm/lib.rs | 4 ---- src/librustc_codegen_utils/codegen_backend.rs | 1 - 2 files changed, 5 deletions(-) (limited to 'src/librustc_codegen_utils') diff --git a/src/librustc_codegen_llvm/lib.rs b/src/librustc_codegen_llvm/lib.rs index 52797e64f7d..6c44c6b8464 100644 --- a/src/librustc_codegen_llvm/lib.rs +++ b/src/librustc_codegen_llvm/lib.rs @@ -258,10 +258,6 @@ impl CodegenBackend for LlvmCodegenBackend { llvm_util::print_version(); } - fn diagnostics(&self) -> &[(&'static str, &'static str)] { - &error_codes::DIAGNOSTICS - } - fn target_features(&self, sess: &Session) -> Vec { target_features(sess) } diff --git a/src/librustc_codegen_utils/codegen_backend.rs b/src/librustc_codegen_utils/codegen_backend.rs index 2e3af8431ee..1077c1f4263 100644 --- a/src/librustc_codegen_utils/codegen_backend.rs +++ b/src/librustc_codegen_utils/codegen_backend.rs @@ -25,7 +25,6 @@ pub trait CodegenBackend { fn target_features(&self, _sess: &Session) -> Vec { vec![] } fn print_passes(&self) {} fn print_version(&self) {} - fn diagnostics(&self) -> &[(&'static str, &'static str)] { &[] } fn metadata_loader(&self) -> Box; fn provide(&self, _providers: &mut Providers<'_>); -- cgit 1.4.1-3-g733a5 From ea60335c286f45ea14fb2049b395e1bced2a1b45 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sun, 13 Oct 2019 12:11:27 +0200 Subject: Add top level provide/provide_extern to cg_ssa and cg_utils --- src/librustc_codegen_ssa/lib.rs | 11 +++++++++++ src/librustc_codegen_utils/lib.rs | 5 +++++ src/librustc_interface/passes.rs | 8 +++----- 3 files changed, 19 insertions(+), 5 deletions(-) (limited to 'src/librustc_codegen_utils') diff --git a/src/librustc_codegen_ssa/lib.rs b/src/librustc_codegen_ssa/lib.rs index 55e465091aa..0221a04b045 100644 --- a/src/librustc_codegen_ssa/lib.rs +++ b/src/librustc_codegen_ssa/lib.rs @@ -27,6 +27,7 @@ use rustc::dep_graph::WorkProduct; use rustc::session::config::{OutputFilenames, OutputType}; use rustc::middle::lang_items::LangItem; use rustc::hir::def_id::CrateNum; +use rustc::ty::query::Providers; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::sync::Lrc; use rustc_data_structures::svh::Svh; @@ -155,3 +156,13 @@ pub struct CodegenResults { pub linker_info: back::linker::LinkerInfo, pub crate_info: CrateInfo, } + +pub fn provide(providers: &mut Providers<'_>) { + crate::back::symbol_export::provide(providers); + crate::base::provide_both(providers); +} + +pub fn provide_extern(providers: &mut Providers<'_>) { + crate::back::symbol_export::provide_extern(providers); + crate::base::provide_both(providers); +} diff --git a/src/librustc_codegen_utils/lib.rs b/src/librustc_codegen_utils/lib.rs index 1201446afb5..66920342ff6 100644 --- a/src/librustc_codegen_utils/lib.rs +++ b/src/librustc_codegen_utils/lib.rs @@ -18,6 +18,7 @@ extern crate rustc; use rustc::ty::TyCtxt; +use rustc::ty::query::Providers; use rustc::hir::def_id::LOCAL_CRATE; use syntax::symbol::sym; @@ -37,3 +38,7 @@ pub fn check_for_rustc_errors_attr(tcx: TyCtxt<'_>) { } } } + +pub fn provide(providers: &mut Providers<'_>) { + crate::symbol_names::provide(providers); +} diff --git a/src/librustc_interface/passes.rs b/src/librustc_interface/passes.rs index 0f120bc606f..346b922ddc8 100644 --- a/src/librustc_interface/passes.rs +++ b/src/librustc_interface/passes.rs @@ -789,15 +789,13 @@ pub fn default_provide(providers: &mut ty::query::Providers<'_>) { cstore::provide(providers); lint::provide(providers); rustc_lint::provide(providers); - rustc_codegen_utils::symbol_names::provide(providers); - rustc_codegen_ssa::back::symbol_export::provide(providers); - rustc_codegen_ssa::base::provide_both(providers); + rustc_codegen_utils::provide(providers); + rustc_codegen_ssa::provide(providers); } pub fn default_provide_extern(providers: &mut ty::query::Providers<'_>) { cstore::provide_extern(providers); - rustc_codegen_ssa::back::symbol_export::provide_extern(providers); - rustc_codegen_ssa::base::provide_both(providers); + rustc_codegen_ssa::provide_extern(providers); } declare_box_region_type!( -- cgit 1.4.1-3-g733a5