Rip out legacy reactivity from the typechecker and HackC
[hiphop-php.git] / hphp / hack / src / oxidized_by_ref / manual / blame_set.rs
blobad6d85f03b024b450120074383857700f0c4040d
1 // Copyright (c) Facebook, Inc. and its affiliates.
2 //
3 // This source code is licensed under the MIT license found in the
4 // LICENSE file in the "hack" directory of this source tree.
6 use std::cmp::Ordering;
8 use serde::Serialize;
10 use no_pos_hash::NoPosHash;
11 use ocamlrep_derive::{FromOcamlRepIn, ToOcamlRep};
13 use crate::{local_id::LocalId, typing_reason::Blame};
15 #[derive(
16     Clone,
17     Debug,
18     Eq,
19     FromOcamlRepIn,
20     Hash,
21     NoPosHash,
22     Ord,
23     Serialize,
24     ToOcamlRep
26 pub struct IdWithBlame<'a>(pub LocalId<'a>, Blame<'a>);
28 impl arena_trait::TrivialDrop for IdWithBlame<'_> {}
30 impl PartialEq for IdWithBlame<'_> {
31     fn eq(&self, other: &Self) -> bool {
32         self.0.eq(&other.0)
33     }
36 impl PartialOrd for IdWithBlame<'_> {
37     fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
38         self.0.partial_cmp(&other.0)
39     }
42 /// A set of LocalIds which treats blame as metadata
43 pub type BlameSet<'a> = arena_collections::set::Set<'a, IdWithBlame<'a>>;