Skip to content

Commit cbdfbdd

Browse files
committed
Implement the query in cstore_impl.
1 parent ed9ee25 commit cbdfbdd

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
lines changed

compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::native_libs;
44
use crate::rmeta::encoder;
55

66
use rustc_ast as ast;
7-
use rustc_ast::expand::allocator::AllocatorKind;
87
use rustc_data_structures::stable_map::FxHashMap;
98
use rustc_data_structures::svh::Svh;
109
use rustc_hir as hir;
@@ -242,6 +241,7 @@ pub fn provide(providers: &mut Providers) {
242241
// therefore no actual inputs, they're just reading tables calculated in
243242
// resolve! Does this work? Unsure! That's what the issue is about
244243
*providers = Providers {
244+
allocator_kind: |tcx, ()| CStore::from_tcx(tcx).allocator_kind(),
245245
is_dllimport_foreign_item: |tcx, id| match tcx.native_library_kind(id) {
246246
Some(
247247
NativeLibKind::Dylib { .. } | NativeLibKind::RawDylib | NativeLibKind::Unspecified,
@@ -535,8 +535,4 @@ impl CrateStore for CStore {
535535
fn encode_metadata(&self, tcx: TyCtxt<'_>) -> EncodedMetadata {
536536
encoder::encode_metadata(tcx)
537537
}
538-
539-
fn allocator_kind(&self) -> Option<AllocatorKind> {
540-
self.allocator_kind()
541-
}
542538
}

compiler/rustc_middle/src/middle/cstore.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use crate::ty::TyCtxt;
66

77
use rustc_ast as ast;
8-
use rustc_ast::expand::allocator::AllocatorKind;
98
use rustc_data_structures::svh::Svh;
109
use rustc_data_structures::sync::{self, MetadataRef};
1110
use rustc_hir::def::DefKind;
@@ -215,7 +214,6 @@ pub trait CrateStore {
215214

216215
// utility functions
217216
fn encode_metadata(&self, tcx: TyCtxt<'_>) -> EncodedMetadata;
218-
fn allocator_kind(&self) -> Option<AllocatorKind>;
219217
}
220218

221219
pub type CrateStoreDyn = dyn CrateStore + sync::Sync;

compiler/rustc_middle/src/ty/context.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2834,5 +2834,4 @@ pub fn provide(providers: &mut ty::query::Providers) {
28342834
// We want to check if the panic handler was defined in this crate
28352835
tcx.lang_items().panic_impl().map_or(false, |did| did.is_local())
28362836
};
2837-
providers.allocator_kind = |tcx, ()| tcx.cstore.allocator_kind();
28382837
}

0 commit comments

Comments
 (0)