diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-05-11 11:35:50 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-05-12 13:58:42 +0200 |
| commit | 3a729915da0e0658843b8c07a2156a8ca027ca77 (patch) | |
| tree | dd37bb655d52ca20f91afa6c6141bd4d5f29f438 /compiler/rustc_codegen_ssa/src | |
| parent | 85a14d70bb2f094f67642ed22f5ffab4a4b9b719 (diff) | |
| download | rust-3a729915da0e0658843b8c07a2156a8ca027ca77.tar.gz rust-3a729915da0e0658843b8c07a2156a8ca027ca77.zip | |
Use () in reachable_set.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/symbol_export.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs index 2bff2fcba43..ba85c70c4a5 100644 --- a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs +++ b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs @@ -4,7 +4,7 @@ use rustc_ast::expand::allocator::ALLOCATOR_METHODS; use rustc_data_structures::fingerprint::Fingerprint; use rustc_data_structures::fx::FxHashMap; use rustc_hir as hir; -use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, CRATE_DEF_INDEX, LOCAL_CRATE}; +use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE}; use rustc_hir::Node; use rustc_index::vec::IndexVec; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; @@ -60,7 +60,7 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, cnum: CrateNum) -> DefIdMap< tcx.is_panic_runtime(LOCAL_CRATE) || tcx.is_compiler_builtins(LOCAL_CRATE); let mut reachable_non_generics: DefIdMap<_> = tcx - .reachable_set(LOCAL_CRATE) + .reachable_set(()) .iter() .filter_map(|&def_id| { // We want to ignore some FFI functions that are not exposed from @@ -355,12 +355,8 @@ fn upstream_drop_glue_for_provider<'tcx>( } } -fn is_unreachable_local_definition_provider(tcx: TyCtxt<'_>, def_id: DefId) -> bool { - if let Some(def_id) = def_id.as_local() { - !tcx.reachable_set(LOCAL_CRATE).contains(&def_id) - } else { - bug!("is_unreachable_local_definition called with non-local DefId: {:?}", def_id) - } +fn is_unreachable_local_definition_provider(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool { + !tcx.reachable_set(()).contains(&def_id) } pub fn provide(providers: &mut Providers) { |
