diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2019-06-11 23:47:08 +0300 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2019-06-12 13:38:27 +0300 |
| commit | 17cdd356da598eb46515352277d3664f05c888ee (patch) | |
| tree | c3bfa4d9040a2407737363cbe5ab9d6a99b2c67a /src/librustc_codegen_ssa | |
| parent | 244125350880ca2f905928cae4115867eedd301a (diff) | |
| download | rust-17cdd356da598eb46515352277d3664f05c888ee.tar.gz rust-17cdd356da598eb46515352277d3664f05c888ee.zip | |
rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.
Diffstat (limited to 'src/librustc_codegen_ssa')
| -rw-r--r-- | src/librustc_codegen_ssa/back/linker.rs | 4 | ||||
| -rw-r--r-- | src/librustc_codegen_ssa/back/symbol_export.rs | 18 | ||||
| -rw-r--r-- | src/librustc_codegen_ssa/back/write.rs | 16 | ||||
| -rw-r--r-- | src/librustc_codegen_ssa/base.rs | 10 | ||||
| -rw-r--r-- | src/librustc_codegen_ssa/common.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_ssa/debuginfo/type_names.rs | 8 | ||||
| -rw-r--r-- | src/librustc_codegen_ssa/traits/backend.rs | 8 |
7 files changed, 33 insertions, 33 deletions
diff --git a/src/librustc_codegen_ssa/back/linker.rs b/src/librustc_codegen_ssa/back/linker.rs index 926f4febe7b..260c07a7b62 100644 --- a/src/librustc_codegen_ssa/back/linker.rs +++ b/src/librustc_codegen_ssa/back/linker.rs @@ -25,7 +25,7 @@ pub struct LinkerInfo { } impl LinkerInfo { - pub fn new(tcx: TyCtxt<'_, '_, '_>) -> LinkerInfo { + pub fn new(tcx: TyCtxt<'_, '_>) -> LinkerInfo { LinkerInfo { exports: tcx.sess.crate_types.borrow().iter().map(|&c| { (c, exported_symbols(tcx, c)) @@ -1012,7 +1012,7 @@ impl<'a> Linker for WasmLd<'a> { } } -fn exported_symbols(tcx: TyCtxt<'_, '_, '_>, crate_type: CrateType) -> Vec<String> { +fn exported_symbols(tcx: TyCtxt<'_, '_>, crate_type: CrateType) -> Vec<String> { if let Some(ref exports) = tcx.sess.target.target.options.override_export_symbols { return exports.clone() } diff --git a/src/librustc_codegen_ssa/back/symbol_export.rs b/src/librustc_codegen_ssa/back/symbol_export.rs index 8d6652d05df..e805cb0003f 100644 --- a/src/librustc_codegen_ssa/back/symbol_export.rs +++ b/src/librustc_codegen_ssa/back/symbol_export.rs @@ -21,7 +21,7 @@ pub type ExportedSymbols = FxHashMap< Arc<Vec<(String, SymbolExportLevel)>>, >; -pub fn threshold(tcx: TyCtxt<'_, '_, '_>) -> SymbolExportLevel { +pub fn threshold(tcx: TyCtxt<'_, '_>) -> SymbolExportLevel { crates_export_threshold(&tcx.sess.crate_types.borrow()) } @@ -46,7 +46,7 @@ pub fn crates_export_threshold(crate_types: &[config::CrateType]) -> SymbolExpor } } -fn reachable_non_generics_provider<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, +fn reachable_non_generics_provider<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, cnum: CrateNum) -> &'tcx DefIdMap<SymbolExportLevel> { @@ -157,7 +157,7 @@ fn reachable_non_generics_provider<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, tcx.arena.alloc(reachable_non_generics) } -fn is_reachable_non_generic_provider_local<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, +fn is_reachable_non_generic_provider_local<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, def_id: DefId) -> bool { let export_threshold = threshold(tcx); @@ -169,13 +169,13 @@ fn is_reachable_non_generic_provider_local<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, } } -fn is_reachable_non_generic_provider_extern<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, +fn is_reachable_non_generic_provider_extern<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, def_id: DefId) -> bool { tcx.reachable_non_generics(def_id.krate).contains_key(&def_id) } -fn exported_symbols_provider_local<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, +fn exported_symbols_provider_local<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, cnum: CrateNum) -> Arc<Vec<(ExportedSymbol<'tcx>, SymbolExportLevel)>> @@ -279,7 +279,7 @@ fn exported_symbols_provider_local<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, } fn upstream_monomorphizations_provider<'tcx>( - tcx: TyCtxt<'tcx, 'tcx, 'tcx>, + tcx: TyCtxt<'tcx, 'tcx>, cnum: CrateNum) -> &'tcx DefIdMap<FxHashMap<SubstsRef<'tcx>, CrateNum>> { @@ -329,7 +329,7 @@ fn upstream_monomorphizations_provider<'tcx>( } fn upstream_monomorphizations_for_provider<'tcx>( - tcx: TyCtxt<'tcx, 'tcx, 'tcx>, + tcx: TyCtxt<'tcx, 'tcx>, def_id: DefId) -> Option<&'tcx FxHashMap<SubstsRef<'tcx>, CrateNum>> { @@ -337,7 +337,7 @@ fn upstream_monomorphizations_for_provider<'tcx>( tcx.upstream_monomorphizations(LOCAL_CRATE).get(&def_id) } -fn is_unreachable_local_definition_provider(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> bool { +fn is_unreachable_local_definition_provider(tcx: TyCtxt<'_, '_>, def_id: DefId) -> bool { if let Some(hir_id) = tcx.hir().as_local_hir_id(def_id) { !tcx.reachable_set(LOCAL_CRATE).0.contains(&hir_id) } else { @@ -359,7 +359,7 @@ pub fn provide_extern(providers: &mut Providers<'_>) { providers.upstream_monomorphizations_for = upstream_monomorphizations_for_provider; } -fn symbol_export_level(tcx: TyCtxt<'_, '_, '_>, sym_def_id: DefId) -> SymbolExportLevel { +fn symbol_export_level(tcx: TyCtxt<'_, '_>, sym_def_id: DefId) -> SymbolExportLevel { // We export anything that's not mangled at the "C" layer as it probably has // to do with ABI concerns. We do not, however, apply such treatment to // special symbols in the standard library for various plumbing between diff --git a/src/librustc_codegen_ssa/back/write.rs b/src/librustc_codegen_ssa/back/write.rs index 5abff2d8ec3..894884e19c3 100644 --- a/src/librustc_codegen_ssa/back/write.rs +++ b/src/librustc_codegen_ssa/back/write.rs @@ -375,7 +375,7 @@ fn need_pre_lto_bitcode_for_incr_comp(sess: &Session) -> bool { pub fn start_async_codegen<B: ExtraBackendMethods>( backend: B, - tcx: TyCtxt<'_, '_, '_>, + tcx: TyCtxt<'_, '_>, metadata: EncodedMetadata, coordinator_receive: Receiver<Box<dyn Any + Send>>, total_cgus: usize @@ -996,7 +996,7 @@ enum MainThreadWorkerState { fn start_executing_work<B: ExtraBackendMethods>( backend: B, - tcx: TyCtxt<'_, '_, '_>, + tcx: TyCtxt<'_, '_>, crate_info: &CrateInfo, shared_emitter: SharedEmitter, codegen_worker_send: Sender<Message<B>>, @@ -1862,7 +1862,7 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> { } pub fn submit_pre_codegened_module_to_llvm(&self, - tcx: TyCtxt<'_, '_, '_>, + tcx: TyCtxt<'_, '_>, module: ModuleCodegen<B::Module>) { self.wait_for_signal_to_codegen_item(); self.check_for_errors(tcx.sess); @@ -1872,7 +1872,7 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> { submit_codegened_module_to_llvm(&self.backend, tcx, module, cost); } - pub fn codegen_finished(&self, tcx: TyCtxt<'_, '_, '_>) { + pub fn codegen_finished(&self, tcx: TyCtxt<'_, '_>) { self.wait_for_signal_to_codegen_item(); self.check_for_errors(tcx.sess); drop(self.coordinator_send.send(Box::new(Message::CodegenComplete::<B>))); @@ -1911,7 +1911,7 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> { pub fn submit_codegened_module_to_llvm<B: ExtraBackendMethods>( _backend: &B, - tcx: TyCtxt<'_, '_, '_>, + tcx: TyCtxt<'_, '_>, module: ModuleCodegen<B::Module>, cost: u64 ) { @@ -1924,7 +1924,7 @@ pub fn submit_codegened_module_to_llvm<B: ExtraBackendMethods>( pub fn submit_post_lto_module_to_llvm<B: ExtraBackendMethods>( _backend: &B, - tcx: TyCtxt<'_, '_, '_>, + tcx: TyCtxt<'_, '_>, module: CachedModuleCodegen ) { let llvm_work_item = WorkItem::CopyPostLtoArtifacts(module); @@ -1936,7 +1936,7 @@ pub fn submit_post_lto_module_to_llvm<B: ExtraBackendMethods>( pub fn submit_pre_lto_module_to_llvm<B: ExtraBackendMethods>( _backend: &B, - tcx: TyCtxt<'_, '_, '_>, + tcx: TyCtxt<'_, '_>, module: CachedModuleCodegen ) { let filename = pre_lto_bitcode_filename(&module.name); @@ -1961,7 +1961,7 @@ pub fn pre_lto_bitcode_filename(module_name: &str) -> String { format!("{}.{}", module_name, PRE_LTO_BC_EXT) } -fn msvc_imps_needed(tcx: TyCtxt<'_, '_, '_>) -> bool { +fn msvc_imps_needed(tcx: TyCtxt<'_, '_>) -> bool { // This should never be true (because it's not supported). If it is true, // something is wrong with commandline arg validation. assert!(!(tcx.sess.opts.cg.linker_plugin_lto.enabled() && diff --git a/src/librustc_codegen_ssa/base.rs b/src/librustc_codegen_ssa/base.rs index b80f01467af..517d19c56a5 100644 --- a/src/librustc_codegen_ssa/base.rs +++ b/src/librustc_codegen_ssa/base.rs @@ -480,7 +480,7 @@ pub const CODEGEN_WORKER_ID: usize = ::std::usize::MAX; pub fn codegen_crate<B: ExtraBackendMethods>( backend: B, - tcx: TyCtxt<'tcx, 'tcx, 'tcx>, + tcx: TyCtxt<'tcx, 'tcx>, metadata: EncodedMetadata, need_metadata_module: bool, rx: mpsc::Receiver<Box<dyn Any + Send>> @@ -703,7 +703,7 @@ impl<B: ExtraBackendMethods> Drop for AbortCodegenOnDrop<B> { } } -fn assert_and_save_dep_graph<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) { +fn assert_and_save_dep_graph<'tcx>(tcx: TyCtxt<'tcx, 'tcx>) { time(tcx.sess, "assert dep graph", || ::rustc_incremental::assert_dep_graph(tcx)); @@ -714,7 +714,7 @@ fn assert_and_save_dep_graph<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) { } impl CrateInfo { - pub fn new(tcx: TyCtxt<'_, '_, '_>) -> CrateInfo { + pub fn new(tcx: TyCtxt<'_, '_>) -> CrateInfo { let mut info = CrateInfo { panic_runtime: None, compiler_builtins: None, @@ -780,7 +780,7 @@ impl CrateInfo { } } -fn is_codegened_item(tcx: TyCtxt<'_, '_, '_>, id: DefId) -> bool { +fn is_codegened_item(tcx: TyCtxt<'_, '_>, id: DefId) -> bool { let (all_mono_items, _) = tcx.collect_and_partition_mono_items(LOCAL_CRATE); all_mono_items.contains(&id) @@ -850,7 +850,7 @@ pub fn provide_both(providers: &mut Providers<'_>) { }; } -fn determine_cgu_reuse<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, +fn determine_cgu_reuse<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, cgu: &CodegenUnit<'tcx>) -> CguReuse { if !tcx.dep_graph.is_fully_enabled() { diff --git a/src/librustc_codegen_ssa/common.rs b/src/librustc_codegen_ssa/common.rs index 0e1885fe29b..82af0049aff 100644 --- a/src/librustc_codegen_ssa/common.rs +++ b/src/librustc_codegen_ssa/common.rs @@ -122,7 +122,7 @@ mod temp_stable_hash_impls { } } -pub fn langcall(tcx: TyCtxt<'_, '_, '_>, +pub fn langcall(tcx: TyCtxt<'_, '_>, span: Option<Span>, msg: &str, li: LangItem) diff --git a/src/librustc_codegen_ssa/debuginfo/type_names.rs b/src/librustc_codegen_ssa/debuginfo/type_names.rs index 695a1c1cbcf..50847b09805 100644 --- a/src/librustc_codegen_ssa/debuginfo/type_names.rs +++ b/src/librustc_codegen_ssa/debuginfo/type_names.rs @@ -8,7 +8,7 @@ use rustc_data_structures::fx::FxHashSet; // any caching, i.e., calling the function twice with the same type will also do // the work twice. The `qualified` parameter only affects the first level of the // type name, further levels (i.e., type parameters) are always fully qualified. -pub fn compute_debuginfo_type_name<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, +pub fn compute_debuginfo_type_name<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, t: Ty<'tcx>, qualified: bool) -> String { @@ -20,7 +20,7 @@ pub fn compute_debuginfo_type_name<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, // Pushes the name of the type as it should be stored in debuginfo on the // `output` String. See also compute_debuginfo_type_name(). -pub fn push_debuginfo_type_name<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, +pub fn push_debuginfo_type_name<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, t: Ty<'tcx>, qualified: bool, output: &mut String, @@ -208,7 +208,7 @@ pub fn push_debuginfo_type_name<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, } } - fn push_item_name(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, + fn push_item_name(tcx: TyCtxt<'tcx, 'tcx>, def_id: DefId, qualified: bool, output: &mut String) { @@ -228,7 +228,7 @@ pub fn push_debuginfo_type_name<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, // reconstructed for items from non-local crates. For local crates, this // would be possible but with inlining and LTO we have to use the least // common denominator - otherwise we would run into conflicts. - fn push_type_params<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, + fn push_type_params<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, substs: SubstsRef<'tcx>, output: &mut String, visited: &mut FxHashSet<Ty<'tcx>>) { diff --git a/src/librustc_codegen_ssa/traits/backend.rs b/src/librustc_codegen_ssa/traits/backend.rs index 40333874c00..e6532f47bc8 100644 --- a/src/librustc_codegen_ssa/traits/backend.rs +++ b/src/librustc_codegen_ssa/traits/backend.rs @@ -31,22 +31,22 @@ impl<'tcx, T> Backend<'tcx> for T where } pub trait ExtraBackendMethods: CodegenBackend + WriteBackendMethods + Sized + Send { - fn new_metadata(&self, sess: TyCtxt<'_, '_, '_>, mod_name: &str) -> Self::Module; + fn new_metadata(&self, sess: TyCtxt<'_, '_>, mod_name: &str) -> Self::Module; fn write_compressed_metadata<'gcx>( &self, - tcx: TyCtxt<'gcx, 'gcx, 'gcx>, + tcx: TyCtxt<'gcx, 'gcx>, metadata: &EncodedMetadata, llvm_module: &mut Self::Module, ); fn codegen_allocator<'gcx>( &self, - tcx: TyCtxt<'gcx, 'gcx, 'gcx>, + tcx: TyCtxt<'gcx, 'gcx>, mods: &mut Self::Module, kind: AllocatorKind ); fn compile_codegen_unit<'a, 'tcx: 'a>( &self, - tcx: TyCtxt<'tcx, 'tcx, 'tcx>, + tcx: TyCtxt<'tcx, 'tcx>, cgu_name: InternedString, ); // If find_features is true this won't access `sess.crate_types` by assuming |
