Skip to content

Commit 90c1601

Browse files
committed
unwrap the correct value in the parallel code
1 parent a482177 commit 90c1601

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

compiler/rustc_query_system/src/query/plumbing.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,12 @@ where
285285
// We didn't find the query result in the query cache. Check if it was
286286
// poisoned due to a panic instead.
287287
let lock = query.query_state(qcx).active.get_shard_by_value(&key).lock();
288-
lock.get(&key).expect_job(query.name());
289-
panic!(
290-
"query result must in the cache or the query must be poisoned after a wait"
291-
);
288+
match lock.get(&key) {
289+
poisoned @ Some(QueryResult::Poisoned) => poisoned.expect_job(query.name()),
290+
_ => panic!(
291+
"query result must in the cache or the query must be poisoned after a wait"
292+
),
293+
}
292294
})
293295
};
294296

0 commit comments

Comments
 (0)