Auto merge of #80692 - Aaron1011:feature/query-result-debug, r=estebank

Enforce that query results implement Debug

Currently, we require that query keys implement `Debug`, but we do not do the same for query values. This can make incremental compilation bugs difficult to debug - there isn't a good place to print out the result loaded from disk.

This PR adds `Debug` bounds to several query-related functions, allowing us to debug-print the query value when an 'unstable fingerprint' error occurs. This required adding `#[derive(Debug)]` to a fairly large number of types - hopefully, this doesn't have much of an impact on compiler bootstrapping times.
This commit is contained in:
bors 2021-01-26 05:47:23 +00:00
commit a8f7075532
23 changed files with 46 additions and 34 deletions

View file

@ -552,6 +552,7 @@ pub fn hash_stable_hashmap<HCX, K, V, R, SK, F>(
/// A vector container that makes sure that its items are hashed in a stable
/// order.
#[derive(Debug)]
pub struct StableVec<T>(Vec<T>);
impl<T> StableVec<T> {

View file

@ -21,6 +21,7 @@ use crate::sync::{MappedReadGuard, ReadGuard, RwLock};
/// -- once the value is stolen -- it will never be read from again.
//
// FIXME(#41710): what is the best way to model linear queries?
#[derive(Debug)]
pub struct Steal<T> {
value: RwLock<Option<T>>,
}