1 use crate::ich::StableHashingContext;
3 use crate::util::nodemap::FxHashSet;
5 use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
8 #[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable)]
9 pub enum SignalledError { SawSomeError, NoErrorsSeen }
11 impl Default for SignalledError {
12 fn default() -> SignalledError {
13 SignalledError::NoErrorsSeen
17 impl_stable_hash_for!(enum self::SignalledError { SawSomeError, NoErrorsSeen });
19 #[derive(Debug, Default, RustcEncodable, RustcDecodable)]
20 pub struct BorrowCheckResult {
21 pub used_mut_nodes: FxHashSet<HirId>,
22 pub signalled_any_error: SignalledError,
25 impl<'a> HashStable<StableHashingContext<'a>> for BorrowCheckResult {
26 fn hash_stable<W: StableHasherResult>(&self,
27 hcx: &mut StableHashingContext<'a>,
28 hasher: &mut StableHasher<W>) {
29 let BorrowCheckResult {
31 ref signalled_any_error,
33 used_mut_nodes.hash_stable(hcx, hasher);
34 signalled_any_error.hash_stable(hcx, hasher);