]> git.proxmox.com Git - rustc.git/blob - vendor/salsa/examples/compiler/values.rs
New upstream version 1.48.0+dfsg1
[rustc.git] / vendor / salsa / examples / compiler / values.rs
1 #[derive(Clone, Debug, Hash, PartialEq, Eq)]
2 pub struct ClassData {
3 pub fields: Vec<Field>,
4 }
5
6 #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
7 pub struct Class(salsa::InternId);
8
9 impl salsa::InternKey for Class {
10 fn from_intern_id(id: salsa::InternId) -> Self {
11 Self(id)
12 }
13
14 fn as_intern_id(&self) -> salsa::InternId {
15 self.0
16 }
17 }
18
19 #[derive(Clone, Debug, Hash, PartialEq, Eq)]
20 pub struct FieldData {
21 pub name: String,
22 }
23
24 #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
25 pub struct Field(salsa::InternId);
26
27 impl salsa::InternKey for Field {
28 fn from_intern_id(id: salsa::InternId) -> Self {
29 Self(id)
30 }
31
32 fn as_intern_id(&self) -> salsa::InternId {
33 self.0
34 }
35 }