Skip to content

Commit 4020f38

Browse files
authored
Unrolled build for rust-lang#123789
Rollup merge of rust-lang#123789 - klensy:rq, r=cjgillot move QueryKeyStringCache from rustc_middle to rustc_query_impl, where it actually used Also allows to drop measureme dep on rustc_middle.
2 parents 46961d2 + 124837d commit 4020f38

File tree

5 files changed

+13
-18
lines changed

5 files changed

+13
-18
lines changed

Diff for: Cargo.lock

-1
Original file line numberDiff line numberDiff line change
@@ -4263,7 +4263,6 @@ dependencies = [
42634263
"either",
42644264
"field-offset",
42654265
"gsgdt",
4266-
"measureme",
42674266
"polonius-engine",
42684267
"rustc-rayon",
42694268
"rustc-rayon-core",

Diff for: compiler/rustc_middle/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ derivative = "2.2.0"
1010
either = "1.5.0"
1111
field-offset = "0.3.5"
1212
gsgdt = "0.1.2"
13-
measureme = "11"
1413
polonius-engine = "0.13.0"
1514
rustc-rayon = { version = "0.5.0", optional = true }
1615
rustc-rayon-core = { version = "0.5.0", optional = true }

Diff for: compiler/rustc_middle/src/query/plumbing.rs

-12
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ use crate::query::{
88
};
99
use crate::ty::TyCtxt;
1010
use field_offset::FieldOffset;
11-
use measureme::StringId;
12-
use rustc_data_structures::fx::FxHashMap;
1311
use rustc_data_structures::sync::AtomicU64;
1412
use rustc_data_structures::sync::WorkerLocal;
1513
use rustc_hir::def_id::{DefId, LocalDefId};
@@ -22,16 +20,6 @@ use rustc_query_system::HandleCycleError;
2220
use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP};
2321
use std::ops::Deref;
2422

25-
pub struct QueryKeyStringCache {
26-
pub def_id_cache: FxHashMap<DefId, StringId>,
27-
}
28-
29-
impl QueryKeyStringCache {
30-
pub fn new() -> QueryKeyStringCache {
31-
QueryKeyStringCache { def_id_cache: Default::default() }
32-
}
33-
}
34-
3523
pub struct DynamicQuery<'tcx, C: QueryCache> {
3624
pub name: &'static str,
3725
pub eval_always: bool,

Diff for: compiler/rustc_query_impl/src/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
extern crate rustc_middle;
1414

1515
use crate::plumbing::{__rust_begin_short_backtrace, encode_all_query_results, try_mark_green};
16+
use crate::profiling_support::QueryKeyStringCache;
1617
use field_offset::offset_of;
1718
use rustc_data_structures::stable_hasher::HashStable;
1819
use rustc_data_structures::sync::AtomicU64;
@@ -21,9 +22,7 @@ use rustc_middle::dep_graph::DepNodeIndex;
2122
use rustc_middle::dep_graph::{self, DepKind, DepKindStruct};
2223
use rustc_middle::query::erase::{erase, restore, Erase};
2324
use rustc_middle::query::on_disk_cache::{CacheEncoder, EncodedDepNodeIndex, OnDiskCache};
24-
use rustc_middle::query::plumbing::{
25-
DynamicQuery, QueryKeyStringCache, QuerySystem, QuerySystemFns,
26-
};
25+
use rustc_middle::query::plumbing::{DynamicQuery, QuerySystem, QuerySystemFns};
2726
use rustc_middle::query::AsLocalKey;
2827
use rustc_middle::query::{
2928
queries, DynamicQueries, ExternProviders, Providers, QueryCaches, QueryEngine, QueryStates,

Diff for: compiler/rustc_query_impl/src/profiling_support.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
use measureme::{StringComponent, StringId};
2+
use rustc_data_structures::fx::FxHashMap;
23
use rustc_data_structures::profiling::SelfProfiler;
34
use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, LOCAL_CRATE};
45
use rustc_hir::definitions::DefPathData;
5-
use rustc_middle::query::plumbing::QueryKeyStringCache;
66
use rustc_middle::ty::TyCtxt;
77
use rustc_query_system::query::QueryCache;
88
use std::fmt::Debug;
99
use std::io::Write;
1010

11+
pub(crate) struct QueryKeyStringCache {
12+
def_id_cache: FxHashMap<DefId, StringId>,
13+
}
14+
15+
impl QueryKeyStringCache {
16+
fn new() -> QueryKeyStringCache {
17+
QueryKeyStringCache { def_id_cache: Default::default() }
18+
}
19+
}
20+
1121
struct QueryKeyStringBuilder<'p, 'tcx> {
1222
profiler: &'p SelfProfiler,
1323
tcx: TyCtxt<'tcx>,

0 commit comments

Comments
 (0)