Skip to content

Commit 07edbec

Browse files
committed
Optimize away a move
1 parent 3133e4f commit 07edbec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustc/ty/query/plumbing.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,13 @@ impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {
253253
RawEntryMut::Vacant(entry) => {
254254
// No job entry for this query. Return a new one to be started later
255255
return tls::with_related_context(tcx, |icx| {
256+
// Create the `parent` variable before `info`. This allows LLVM
257+
// to elide the move of `info`
258+
let parent = icx.query.map(|q| LrcRef::into(q));
256259
let info = QueryInfo {
257260
span,
258261
query: Q::query(key.clone()),
259262
};
260-
let parent = icx.query.map(|q| LrcRef::into(q));
261263
let job = Lrc::new(QueryJob::new(info, parent));
262264
let owner = job_storage.init(JobOwner {
263265
cache,

0 commit comments

Comments
 (0)