Skip to content

Commit 3133e4f

Browse files
committed
intsort
1 parent 21ac2fa commit 3133e4f

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

src/librustc/ty/query/plumbing.rs

+36-3
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,39 @@ pub(super) struct JobOwner<'a, 'tcx: 'a, Q: QueryDescription<'tcx> + 'a> {
103103
layout_depth: usize,
104104
}
105105

106+
#[no_mangle]
107+
fn size_JobOwner() -> usize {
108+
std::mem::size_of::<JobOwner<::ty::query::queries::type_of>>()
109+
}
110+
111+
#[no_mangle]
112+
fn size_QueryJob() -> usize {
113+
std::mem::size_of::<QueryJob>()
114+
}
115+
116+
#[no_mangle]
117+
fn size_Query() -> usize {
118+
std::mem::size_of::<::ty::query::Query>()
119+
}
120+
121+
use hir::def_id::DefId;
122+
123+
#[no_mangle]
124+
fn size_DefId() -> usize {
125+
std::mem::size_of::<DefId>()
126+
}
127+
use hir::def_id::CrateId;
128+
#[no_mangle]
129+
fn size_CrateId() -> usize {
130+
std::mem::size_of::<CrateId>()
131+
}
132+
133+
use hir::def_id::CrateNum;
134+
#[no_mangle]
135+
fn size_CrateNum() -> usize {
136+
std::mem::size_of::<CrateNum>()
137+
}
138+
106139
use std::mem::MaybeUninit;
107140
#[inline(never)]
108141
pub fn may_panic<'tcx>(job: Lrc<QueryJob<'tcx>>) {
@@ -115,7 +148,7 @@ pub fn test_space() {
115148

116149
#[no_mangle]
117150
fn test_moves2<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
118-
key: &::hir::def_id::DefId, key_hash: u64,
151+
key: &DefId, key_hash: u64,
119152
span: Span,
120153
parent: &Option<Lrc<QueryJob<'tcx>>>,
121154
mut job_storage: MoveSlot<'a, JobOwner<'a, 'tcx, ::ty::query::queries::type_of<'tcx>>>,
@@ -128,7 +161,7 @@ fn test_moves2<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
128161
query: ::ty::query::queries::type_of::query(*key),
129162
};
130163
*Lrc::get_mut(&mut job).unwrap() =
131-
MaybeUninit::new(QueryJob::new(info, parent));
164+
MaybeUninit::new(QueryJob::new(info, parent.clone()));
132165
let job: Lrc<QueryJob<'tcx>> = unsafe { std::mem::transmute(job) };
133166
let job_clone = job.clone();
134167
may_panic(job);
@@ -151,11 +184,11 @@ fn test_moves<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
151184
use ty::query::config::QueryAccessors;
152185
tls::with_related_context(tcx, |icx| {
153186
let mut job = Lrc::new(MaybeUninit::uninitialized());
154-
let parent = icx.query.clone();
155187
let info = QueryInfo {
156188
span,
157189
query: ::ty::query::queries::type_of::query(*key),
158190
};
191+
let parent = icx.query.map(|q| LrcRef::into(q));
159192
*Lrc::get_mut(&mut job).unwrap() =
160193
MaybeUninit::new(QueryJob::new(info, parent));
161194
let job: Lrc<QueryJob<'tcx>> = unsafe { std::mem::transmute(job) };

0 commit comments

Comments
 (0)